login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A239133 Numbers n such that n^p_1 + n^p_2 + ... + n^p_k + 1 is prime where p_1,...p_k denote each prime factor of n, not necessarily distinct. 1

%I #26 Mar 13 2014 19:22:56

%S 2,8,9,12,20,28,39,48,72,90,92,96,120,128,162,272,308,340,408,472,486,

%T 510,572,690,810,912,936,972,1107,1224,1312,1444,1632,1734,1870,1890,

%U 2002,2106,2432,2592,2912,2916,3004,3068,3768,3834,4256,4394,4557,4725

%N Numbers n such that n^p_1 + n^p_2 + ... + n^p_k + 1 is prime where p_1,...p_k denote each prime factor of n, not necessarily distinct.

%H Charles R Greathouse IV, <a href="/A239133/b239133.txt">Table of n, a(n) for n = 1..112</a>

%e 12 = 2*2*3 and 12^2+12^2+12^3+1 = 2017 is prime. Thus, 12 is a member of this sequence.

%p isA239133 := proc(n)

%p ps := ifactors(n)[2] ;

%p 1+add( op(2,p)*n^op(1,p),p=ps) ;

%p isprime(%) ;

%p end proc:

%p for n from 1 do

%p if isA239133(n) then

%p printf("%d,\n",n) ;

%p end if;

%p end do: # _R. J. Mathar_, Mar 13 2014

%o (Python)

%o import sympy

%o from sympy import factorint

%o from sympy import isprime

%o def Exp(x):

%o ..lst = []

%o ..for i in range(len(factorint(x).values())):

%o ....for a in range(list(factorint(x).values())[i]):

%o ......lst.append(list(factorint(x))[i])

%o ..num = 1

%o ..for n in lst:

%o ....num += x**n

%o ..if isprime(num):

%o ....return True

%o x = 1

%o while x < 10**4:

%o ..if Exp(x):

%o ....print(x)

%o ..x += 1

%o (PARI) is(n)=my(f=factor(n));ispseudoprime(sum(i=1,#f~,f[i,2]*n^f[i,1])+1) \\ _Charles R Greathouse IV_, Mar 12 2014

%K nonn

%O 1,1

%A _Derek Orr_, Mar 10 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 00:30 EDT 2024. Contains 371917 sequences. (Running on oeis4.)