OFFSET
1,1
COMMENTS
MATHEMATICA
a[n_, poly_] := FromDigits[FoldList[{Mod[#[[1]], #2], Quotient[#[[1]], #2]} &, {n, 0}, Reverse[Map[(poly - 2) # (# - 1)/2 + # &,
Range[Floor[Sqrt[2 n]]]]]][[All, 2]]]
t4 = Map[a[#, 4] &, Range[200]]; (* A007961 *)
m = Mod[t4, 10];
Table[Flatten[Position[m, r]], {r, 0, 2}]
p0 = Flatten[Position[m, 0]] (* this sequence *)
p1 = Flatten[Position[m, 1]] (* A376358 *)
p2 = Flatten[Position[m, 2]] (* A376359 *)
p3 = Flatten[Position[m, 3]] (* A376360 *)
(* Peter J. C. Moses, Sep 20 2024 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Clark Kimberling, Sep 25 2024
STATUS
approved