The latest review of mathematics by HMIE has found "important or major weaknesses" in attainment at S1 to S4 in two-fifths of secondary schools.
One senior maths figure has suggested the quality of pupil information from primaries accounts for halting progress in S1.
Inspectors found the overall quality of attainment to be "very good" in a quarter of schools in S5-S6. But, at the S1-S2 stage, attainment was very good in only 5 per cent of schools.
The Improving Achievement in Mathematics report, published yesterday (Thursday), paints a picture of uneven progress, with gains at the early stages not always sustained in later primary and early secondary. This is borne out by the latest maths survey from the Assessment of Achievement Programme, also published yesterday (page four).
Graham Donaldson, senior chief inspector, said: "Improvements are evident in the teaching of mental mathematics in primary schools and in the assessment of pupils' ability to do calculations without using a calculator."
Mr Donaldson described the overall quality of mathematics as good, with a number of key strengths. These included a very good start for the youngest pupils, which was "a major strength of which we should be proud".
At the same time, almost all pupils achieve at least SCQF level 3 (Standard grade Foundation award or Access 3) by the time they complete S4.
International studies also showed strengths in the achievement of Scottish pupils in S2 and S3 in aspects of mathematics, Mr Donaldson said.
However, schools were failing the tail-end 20 per cent of chronic underachievers and, he added significantly, he had "a particular concern about our current capacity to address the needs of young people for whom learning presents a major challenge".
Mr Donaldson commented: "We need to do more to identify early enough those pupils who are likely to be within the lowest achieving group nationally, and plan specific, targeted approaches which will engage them more effectively in learning that is designed to promote and improve their levels of numeracy."
Too often pupils did not see the relevance of the mathematics they were being taught, nor the connections with the skills they needed in other subjects.
Mr Donaldson said: "Employers and staff in higher education institutions continue to express concern about the basic mathematical abilities of young people. How well equipped to face a rapidly changing society are the 16-year-olds who leave school having achieved SCQF level 3 in mathematics?"
The transitional stages from primary to secondary continue to cause concern, with inspectors finding that too many pupils at P7 and S2 are making little progress at these stages. High failure rates at Intermediate 1 are "of particular concern."
The report says that the introduction of Standard grade courses in S2 and S3 are not, as yet, raising attainment. "The focus for schools should be on meeting the needs of all pupils through ensuring continuity and progression in pupils' learning," it states.
There is praise for improvements in the quality of learning and teaching in primary, particularly in the range of interactive and direct teaching approaches being used.
But teachers at all levels need to improve the quality of learning and teaching and education authorities need to do more to help them improve, inspectors say. Secondary maths teachers should work closely with teachers of other subjects which use mathematics.
Eddie Mullan, a principal maths teacher who sits on the Scottish Mathematical Council, defended teachers over the "treading water problem"
in S1-S2, saying that those in early secondary had a year to get pupils from level D when they arrive in S1 to the next level - an 18-month jump.
Mr Mullan echoed one of the findings from the AAP survey, that some primaries were trying to take pupils too quickly through the 5-14 levels.
Chris Pritchard, a principal teacher of maths and a member of the Scottish Mathematical Council, said: "There is more than a hint in the report that the lack of detail in the information passed on to secondary schools is one factor in the apparent lack of progress made by pupils in S1. The challenge will be for primary heads to create the time their P7 teachers will need to report pupil progress in greater detail."
Dr Pritchard expressed surprise that there was little comment on the creation in some schools of mathematics teams with no specialist principal teacher. "The effects of the collapse of the advisory service are recognised only in relation to rural schools," he said.
"This is in direct contrast to the significant concern of secondary mathematics teachers, revealed in the Scottish Mathematical Council's survey and reported in The TES Scotland last week."