

A284048


a(n) is the smallest positive integer not already in the sequence such that a(n) + a(n1) is a proper prime power (A246547), with a(1) = 1.


2



1, 3, 5, 4, 12, 13, 14, 2, 6, 10, 15, 17, 8, 19, 30, 34, 47, 74, 7, 9, 16, 11, 21, 28, 36, 45, 76, 49, 32, 89, 39, 25, 24, 40, 41, 23, 26, 38, 43, 78, 50, 31, 18, 46, 35, 29, 20, 44, 37, 27, 22, 42, 79, 90, 153, 103, 66, 55, 70, 51, 77, 48, 33, 88, 81, 162, 94, 75, 53, 68, 57, 64, 61, 60, 65, 56, 69, 52, 73, 96, 147
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


LINKS

Robert Israel, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Prime Power
Index entries for sequences that are permutations of the natural numbers


EXAMPLE

a(5) = 12 because 1, 3, 4 and 5 have already been used in the sequence, 4 + 2 = 6, 4 + 6 = 10, 4 + 7 = 11, 4 + 8 = 12, 4 + 9 = 13, 4 + 10 = 14 and 4 + 11 = 15 are not proper prime powers while 4 + 12 = 16 is a proper prime power.


MAPLE

N:= 2000: # to get all terms before the first where a(n)+a(n1)>N
PP:= {seq(seq(p^j, j =2..floor(log[p](N))), p = select(isprime, [2, seq(i, i=3..floor(sqrt(N)), 2)]))}:
PP:= sort(convert(PP, list)):
V:= Vector(N, datatype=integer[1], 1):
A[1]:= 1; V[1]:= 0;
for n from 2 do
for pp in PP do
t:= pp  A[n1];
if t > 0 and V[t] = 1 then
A[n]:= t; V[t]:= 0; break
fi;
od;
if not assigned(A[n]) then break fi
od:
seq(A[i], i=1..n1); # Robert Israel, Apr 24 2017


MATHEMATICA

f[s_List] := Block[{k = 1, a = s[[1]]}, While[MemberQ[s, k]  ! (PrimePowerQ[a + k] && PrimeOmega[a + k] > 1), k++]; Append[s, k]]; Nest[f, {1}, 80]


CROSSREFS

Cf. A055265, A055266, A121878, A228730, A243625, A246547, A284049.
Sequence in context: A007063 A335500 A127397 * A326119 A201271 A324779
Adjacent sequences: A284045 A284046 A284047 * A284049 A284050 A284051


KEYWORD

look,nonn


AUTHOR

Ilya Gutkovskiy, Mar 19 2017


STATUS

approved



