[go: up one dir, main page]

login
Search: a021559 -id:a021559
     Sort: relevance | references | number | modified | created      Format: long | short | data
Smallest number whose digital sum is n^3.
+10
6
0, 1, 8, 999, 19999999, 89999999999999, 999999999999999999999999, 199999999999999999999999999999999999999, 899999999999999999999999999999999999999999999999999999999
OFFSET
0,3
COMMENTS
Except for the leading digit all the other digits of a(n), n >= 1, are 9's and the leading digit is 1 or 8. (This is because the digital sum of n^3 is congruent to 0, 1, or 8 mod 9, so the best we can do is use as many 9's as possible, prefixed if necessary by 1 or 8. - N. J. A. Sloane, Jul 19 2018)
LINKS
FORMULA
a(n) =((n mod 3)^3+1)*10^floor[n^3/9]-1 =(A021559(n+1)+1)*10^A061263(n)-1. - Henry Bottomley, Apr 24 2001
EXAMPLE
a(4) = 19999999, 1+9+9+9+9+9+9+9 = 64 = 4^3.
MATHEMATICA
Do[a = {}; While[Apply[Plus, a] + 9 < n^3, a = Append[a, 9]]; If[ Apply[ Plus, a] != n^3, a = Prepend[ a, n^3 - Apply[ Plus, a]] ]; Print[ FromDigits[ a]], {n, 1, 10} ]
dsn3[n_]:=Module[{t=(n^3-{0, 1, 8})/9}, Which[ IntegerQ[t[[1]]], FromDigits[ PadRight[ {}, t[[1]], 9]], IntegerQ[t[[2]]], FromDigits[ PadRight[ {1}, t[[2]]+1, 9]], IntegerQ[t[[3]]], FromDigits[PadRight[{8}, t[[3]]+1, 9]]]]; Array[dsn3, 10, 0] (* Harvey P. Dale, Jul 19 2018 *)
PROG
(PARI) { for (n=0, 20, a=((n%3)^3 + 1)*10^(n^3\9) - 1; write("b061105.txt", n, " ", a) ) } \\ Harry J. Smith, Jul 19 2009
CROSSREFS
Cf. A061104.
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, Apr 20 2001
EXTENSIONS
More terms from Robert G. Wilson v, Apr 21 2001
STATUS
approved
a(n) = n^3 mod 9.
+10
6
0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8
OFFSET
0,3
COMMENTS
Essentially a duplicate of A021559. - N. J. A. Sloane, Oct 30 2009
Equivalently: n^(6*m + 3) mod 9. - G. C. Greubel, Jun 04 2016
Decimal expansion of 2/111. - Elmo R. Oliveira, Feb 19 2024
FORMULA
G.f.: -x*(1+8*x) / ( (x-1)*(1+x+x^2) ). - R. J. Mathar, Aug 24 2016
MATHEMATICA
Table[Mod[n^3, 9], {n, 0, 200}] (* Vladimir Joseph Stephan Orlovsky, Apr 23 2011 *)
PROG
(Sage) [power_mod(n, 3, 9 ) for n in range(0, 105)]
(PARI) a(n)=n^3%9 \\ Charles R Greathouse IV, Apr 06 2016
(PARI) a(n)=[0, 1, 8][n%3+1]; \\ Joerg Arndt, Feb 20 2024
KEYWORD
nonn,easy
AUTHOR
Zerinvary Lajos, Oct 29 2009
STATUS
approved
Table T(n,k) by antidiagonals of n^k mod k [n,k >= 1].
+10
4
0, 1, 0, 1, 0, 0, 1, 2, 1, 0, 1, 0, 0, 0, 0, 1, 2, 1, 1, 1, 0, 1, 4, 3, 0, 2, 0, 0, 1, 2, 3, 4, 1, 0, 1, 0, 1, 0, 3, 4, 0, 0, 1, 0, 0, 1, 8, 1, 4, 1, 1, 1, 2, 1, 0, 1, 4, 0, 0, 5, 0, 2, 0, 0, 0, 0, 1, 2, 9, 1, 1, 6, 1, 3, 1, 1, 1, 0, 1, 4, 3, 6, 8, 0, 0, 4, 4, 0, 2, 0, 0, 1, 2, 9, 4, 5, 0, 1, 1, 3, 0, 1, 0, 1, 0
OFFSET
1,8
LINKS
FORMULA
T(n, k) = A051129(n, k)-n*A060155(n, k).
EXAMPLE
T(5,3) = 5^3 mod 3 = 125 mod 3 = 2.
Rows start:
0, 1, 1, 1, 1, ...
0, 0, 2, 0, 2, ...
0, 1, 0, 1, 3, ...
0, 0, 1, 0, 4, ...
0, 1, 2, 1, 0, ...
CROSSREFS
Rows include A057427, A015910, A056969.
Columns include A000004, A000035 (several times), A010872, A010874, A010876, A021559 and other periodic sequences.
Diagonals include A000004 and A057427.
Cf. A114448.
KEYWORD
nonn,tabl
AUTHOR
Henry Bottomley, Mar 12 2001
STATUS
approved
Array a(n,k) = n^k (mod k) read by antidiagonals (k>=1, n>=1).
+10
1
0, 0, 1, 0, 0, 1, 0, 1, 2, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 1, 0, 0, 2, 0, 3, 4, 1, 0, 1, 0, 1, 4, 3, 2, 1, 0, 0, 1, 0, 0, 4, 3, 0, 1, 0, 1, 2, 1, 1, 1, 4, 1, 8, 1, 0, 0, 0, 0, 2, 0, 5, 0, 0, 4, 1, 0, 1, 1, 1, 3, 1, 6, 1, 1, 9, 2, 1, 0, 0, 2, 0, 4, 4, 0, 0, 8, 6, 3, 4, 1, 0, 1, 0, 1, 0, 3, 1, 1, 0, 5, 4, 9, 2, 1
OFFSET
1,9
COMMENTS
Alternate description: triangular array a(n, k) = n^k (mod k) read by rows (n > 1, 0 < k < n). This is equivalent because a(n, k) = a(n-k, k). - David Wasserman, Jan 25 2007
EXAMPLE
2^6 = 64 and 64 (mod 6) is 4. So a(2,6) = 4.
MATHEMATICA
a[n_, k_] := Mod[n^k, k]; Table[a[n - k + 1, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Dec 12 2012 *)
KEYWORD
easy,nonn,tabl
AUTHOR
Leroy Quet, Feb 14 2006
EXTENSIONS
More terms from David Wasserman, Jan 25 2007
STATUS
approved

Search completed in 0.007 seconds