A244425 Consider the sequence of almost natural numbers (A007376) and arrange it in a table by antidiagonals; sequence gives the main diagonal.
1, 5, 1, 7, 5, 5, 7, 1, 7, 5, 1, 1, 1, 5, 1, 1, 1, 2, 2, 9, 3, 3, 7, 4, 4, 7, 5, 5, 7, 6, 6, 9, 7, 7, 3, 8, 9, 7, 8, 7, 7, 8, 0, 3, 7, 2, 8, 5, 3, 2, 2, 3, 5, 8, 2, 7, 3, 0, 8, 7, 7, 8, 0, 3, 7, 2, 8, 5, 3, 2, 2, 3, 5, 8, 2, 7, 3, 0, 8, 7, 7, 8, 0, 3, 7, 2, 8, 5, 3, 2, 2, 3, 5, 8, 2, 7, 3, 0, 8, 7, 7, 8, 0, 3, 7
Offset: 1
Programs
-
Mathematica
almostNatural[n_, b_] := almostNatural[n, b] = Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; f[n_, m_] := (n + m - 2) (n + m - 1)/2 + m; Array[ almostNatural[ f[#, #], 10] &, 105] (* modified Jun 29 2014 *)
Comments