Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #19 Jul 10 2021 04:35:11
%S 0,2,6,10,12,18,20,30,34,42,56,66,68,72,84,90,110,130,132,156,182,210,
%T 222,240,246,258,260,272,306,342,350,380,420,462,506,514,520,552,600,
%U 630,650,702,732,738,756,812,870,930,992,1010,1026,1028,1056,1122,1190,1260,1302
%N Numbers of the form m^k + m, with m >= 0 and k > 1.
%H Robert Israel, <a href="/A253913/b253913.txt">Table of n, a(n) for n = 1..10000</a>
%p N:= 10000: # for terms <= N
%p S:= 0, 2:
%p for k from 2 to floor(log[2](N)) do
%p for m from 2 do
%p v := m^k+m; if v > N then break fi;
%p S:= S, v;
%p od od:
%p sort(convert({S}, list)): # _Robert Israel_, Apr 28 2019, changed Jul 8 2021
%t max = 1000; Sort[Flatten[Table[m^k + m, {m, 2, Floor[Sqrt[max]]}, {k, 2, Floor[Log[m, max]]}]]] (* _Alonso del Arte_, Jan 18 2015 *)
%o (Python)
%o def aupto(lim):
%o xkx = set(x**k + x for k in range(2, lim.bit_length()) for x in range(int(lim**(1/k))+2))
%o return sorted(filter(lambda t: t<=lim, xkx))
%o print(aupto(1500)) # _Michael S. Branicky_, Jul 08 2021
%Y Cf. A099225, A253914.
%K nonn
%O 1,2
%A _Alex Ratushnyak_, Jan 18 2015
%E Changed to include 0 and 2 by _Robert Israel_, Jul 08 2021