OFFSET
0,3
COMMENTS
Could also be called "bidigital root" of n^2.
When defining the bidigital root of a number, you must add the number's 2-digit groups starting from the RIGHT. If you start from the left and your number has an even number of digits, it will be correct, but if you start from the left and your number has an odd number of digits, you'll usually be wrong. For example, if you start from the left dealing with 121, you're going to get 12 + 1 = 13, not 21 + 1 = 22. (In fact, the number you'll have the bidigital root of is a number whose digits differ from the original number solely in that there's an additional 0 between the last 2 digits; in this case 1201.
The definition "bidigital root of n" simply produces a periodic sequence where the numbers 1 to 99 repeat in cycles of 99.
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..990
EXAMPLE
a(11) = 22 because 11^2 is 121 and the bidigital root of 121 is 21 + 1 = 22.
MATHEMATICA
Table[NestWhile[Total@ IntegerDigits[#, 100] &, n^2, IntegerLength@ # >= 3 &], {n, 0, 98}] (* Michael De Vlieger, Oct 14 2016 *)
PROG
(PARI) bdr(n) = n-99*floor((n-1)/99);
a(n) = bdr(n^2); \\ Michel Marcus, Oct 10 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. Lowell, Oct 09 2016
EXTENSIONS
Replaced definition with simpler definition from Michael De Vlieger. - N. J. A. Sloane, Nov 05 2016
STATUS
approved