OFFSET
1,1
EXAMPLE
223 belongs to this sequence because 2+2+3=7, 2^2+2^2+3^2=17, 2^3+2^3+3^3=43, 2^4+2^4+3^4=113, 2^5+2^5+3^5=307, and 2^6+2^6+3^6=857 are prime numbers whereas 2^7+2^7+3^7 is a composite number.
MAPLE
filter:= proc(n) local L, t, k;
L:= convert(n, base, 10);
andmap(isprime, [seq(add(t^k, t=L), k=1..6)]) and not isprime(add(t^7, t=L))
end proc:
select(filter, [$1..20000]); # Robert Israel, Jan 03 2023
MATHEMATICA
For[a = 0, a <= 9, a++,
For[b = 0, b <= 9, b++,
For[c = 0, c <= 9, c++,
For[d = 0, d <= 9, d++,
If[PrimeQ[a + b + c + d] == True &&
PrimeQ[a^2 + b^2 + c^2 + d^2] == True &&
PrimeQ[a^3 + b^3 + c^3 + d^3] == True &&
PrimeQ[a^4 + b^4 + c^4 + d^4] == True &&
PrimeQ[a^5 + b^5 + c^5 + d^5] == True &&
PrimeQ[a^6 + b^6 + c^6 + d^6] == True &&
PrimeQ[a^7 + b^7 + c^7 + d^7] == False, Print[a, b, c, d]]]]]]
(* This code outputs all the terms of the sequence in the interval [1, 10^4]. *)
PROG
(PARI) isok(n) = my(d=digits(n)); for (i=1, 6, if (!isprime(sum(k=1, #d, d[k]^i)), return(0))); !isprime(sum(k=1, #d, d[k]^7)); \\ Michel Marcus, Jan 02 2023
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
José Hernández, Jan 02 2023
STATUS
approved