|
|
A130225
|
|
a(1) = 2; a(n) = a(n-1) + (number of times the digit 2 has appeared in the sequence so far).
|
|
1
|
|
|
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 23, 27, 32, 38, 44, 50, 56, 62, 69, 76, 83, 90, 97, 104, 111, 118, 125, 133, 141, 149, 157, 165, 173, 181, 189, 197, 205, 214, 224, 236, 249, 263, 278, 294, 311, 328, 346, 364, 382, 401, 420, 440, 460, 480, 500, 520
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
MAPLE
|
option remember;
if n = 1 then
2;
else
a := procname(n-1) ;
for j from 1 to n-1 do
for d in convert(procname(j), base, 10) do
if d = 2 then
a := a+1 ;
end if;
end do:
end do:
a ;
end if;
end proc:
|
|
MATHEMATICA
|
nxt[{t_, a_}]:=Module[{k=a+t}, {t+DigitCount[k, 10, 2], k}]; NestList[nxt, {1, 2}, 60][[All, 2]] (* Harvey P. Dale, Jun 03 2021 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|