OFFSET
1,2
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
283 is in the sequence because 2^2+8^2+3^2 + 2^2*8^2*3^2 = 77 + 2304 = 2381 is prime.
MAPLE
A:= proc(n) add(d^2, d=convert(n, base, 10)) ; end proc:
B:= proc(n) mul(d^2, d=convert(n, base, 10)) ; end proc:
isA:= proc(n) isprime(A(n)+B(n)) ; end proc:
for n from 1 to 1000 do if isA(n) then printf("%a, ", n) ; end if; end do:
PROG
(PARI) is(n)=my(v=eval(Vec(Str(n)))); isprime(sum(i=1, #v, v[i]^2)+prod(i=1, #v, v[i]^2)) \\ Charles R Greathouse IV, Aug 02 2012
(Magma) dd:=func<n | [d^2: d in Intseq(n)]>; [n: n in [1..520] | IsPrime(&+dd(n)+&*dd(n))]; // Bruno Berselli, Aug 02 2012
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Michel Lagneau, Aug 01 2012
STATUS
approved