A139751 Primes arising in A139749.
2, 3, 5, 7, 2, 3, 5, 7, 5, 7, 11, 13, 11, 13, 17, 17, 19, 23, 5
Offset: 1
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
1583 is in the sequence because : 1 + 5^2 + 8^3 + 3^4 = 619 and 1^4 + 5^3 + 8^2 + 3^1 = 193 are prime numbers.
with(numtheory):for n from 1 to 1000 do:l:=length(n):n0:=n:s1:=0:s2:=0:for m from 1 to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :s1:=s1+u^(l-m+1):s2:=s2+u^m:od: if type(s1,prime)=true and type(s2,prime)=true then printf(`%d, `,n):else fi:od:
okQ[n_] := Module[{d=IntegerDigits[n], r}, r=Length[d]; PrimeQ[Total[d^Range[r]]] && PrimeQ[Total[d^Range[r, 1, -1]]]]; Select[Range[1000], okQ]
The first four terms are the single-digit primes; a(5) = 11 since 1^2 + 1^2 = 2, which is prime.
filter:= proc(n) local L,d,t; L:= convert(n,base,10); d:= nops(L); isprime(add(t^d, t=L)) end proc: select(filter, [$1..1000]); # Robert Israel, Oct 17 2023
Select[Range[250], (d = IntegerDigits[#]; PrimeQ@ Total[d^Length[d]]) &] (* Giovanni Resta, Dec 02 2019 *)
isok(n) = {my(d = digits(n)); isprime(sum(k=1, #d, d[k]^#d));} \\ Michel Marcus, Dec 05 2019
n=321 : 3/3 + 2/2 + 1/1 = 3, 321 belongs to the sequence
Join[{0},Select[Range[400],IntegerQ[Total[IntegerDigits[#]/Reverse[ Range[ IntegerLength[ #]]]]]&]] (* Harvey P. Dale, May 17 2016 *)
Comments