login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A004905 Numbers that are the sum of at most 10 nonzero 10th powers. 2

%I #17 Aug 04 2020 21:53:56

%S 0,1,2,3,4,5,6,7,8,9,10,1024,1025,1026,1027,1028,1029,1030,1031,1032,

%T 1033,2048,2049,2050,2051,2052,2053,2054,2055,2056,3072,3073,3074,

%U 3075,3076,3077,3078,3079,4096,4097,4098,4099,4100,4101,4102,5120,5121,5122,5123

%N Numbers that are the sum of at most 10 nonzero 10th powers.

%H Alois P. Heinz, <a href="/A004905/b004905.txt">Table of n, a(n) for n = 1..10000</a>

%p b:= proc(n, i, t) option remember; n=0 or i>0 and t>0

%p and (b(n, i-1, t) or i^10<=n and b(n-i^10, i, t-1))

%p end:

%p a:= proc(n) option remember; local k;

%p for k from 1+ `if`(n=1, -1, a(n-1))

%p while not b(k, iroot(k, 10), 10) do od; k

%p end:

%p seq(a(n), n=1..60); # _Alois P. Heinz_, Sep 16 2016

%t b[n_, i_, t_] := b[n, i, t] = n == 0 || i > 0 && t > 0 && (b[n, i - 1, t] || i^10 <= n && b[n - i^10, i, t - 1]);

%t a[n_] := a[n] = (For[k = 1 + If[n == 1, -1, a[n - 1]], !b[k, k^(1/10) // Floor, 10], k++]; k);

%t Array[a, 60] (* _Jean-François Alcover_, Apr 06 2017, after _Alois P. Heinz_ *)

%Y Column k=10 of A336820.

%K nonn

%O 1,3

%A _N. J. A. Sloane_

%E More terms from _Alois P. Heinz_, Sep 16 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 03:28 EDT 2024. Contains 371235 sequences. (Running on oeis4.)