login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Odd prime powers.
44

%I #51 Feb 02 2023 12:46:50

%S 1,3,5,7,9,11,13,17,19,23,25,27,29,31,37,41,43,47,49,53,59,61,67,71,

%T 73,79,81,83,89,97,101,103,107,109,113,121,125,127,131,137,139,149,

%U 151,157,163,167,169,173,179,181,191,193,197,199,211,223,227,229,233,239

%N Odd prime powers.

%C Let a(n)=p^e, then tau(a(n)^2) = tau(p^(2*e)) = 2*e+1 = 2*(e+1)-1 = tau(2*a(n))-1 where tau=A000005. - _Juri-Stepan Gerasimov_, Jul 14 2011

%H Robert Israel, <a href="/A061345/b061345.txt">Table of n, a(n) for n = 0..10000</a>

%H L. J. Corwin, <a href="/A033948/a033948.pdf">Irreducible polynomials over the integers which factor mod p for every p</a>, Unpublished Bell Labs Memo, Sep 07 1967 [Annotated scanned copy]

%F a(n) = A061344(n)-1.

%F Intersection of A000961 (prime powers) and A005408 (odd numbers). - _Robert Israel_, Jun 11 2014

%p select(t -> nops(ifactors(t)[2])<=1, [seq(2*i+1,i=0..1000)]); # _Robert Israel_, Jun 11 2014

%p # alternative:

%p A061345 := proc(n)

%p option remember;

%p local k ;

%p if n = 0 then

%p 1;

%p else

%p for k from procname(n-1)+2 by 2 do

%p if nops(numtheory[factorset](k)) = 1 then

%p return k ;

%p end if;

%p end do:

%p end if;

%p end proc: # _R. J. Mathar_, Jun 25 2016

%p isOddPrimepower := n -> type(n, 'primepower') and not type(n, 'even'):

%p A061345List := up_to -> select(isOddPrimepower, [`$`(1..up_to)]):

%p A061345List(240); # _Peter Luschny_, Feb 02 2023

%t t={1};k=0;Do[If[k==1,AppendTo[t,a1]];k=0;Do[c=Sqrt[a^2+b^2];If[IntegerQ[c]&&GCD[a,b,c]==1,k++;a1=a;b1=b;c1=c;],{b,4,a^2/2,2}],{a,3,260,2}];t (* _Vladimir Joseph Stephan Orlovsky_, Jan 29 2012 *)

%t Select[2 Range@ 130 - 1, PrimeNu@# < 2 &] (* _Robert G. Wilson v_, Jun 12 2014 *)

%o (Magma) [1] cat [n: n in [3..300 by 2] | IsPrimePower(n)]; // _Bruno Berselli_, Feb 25 2016

%o (PARI) is(n)=my(p); if(isprimepower(n,&p), p>2, n==1) \\ _Charles R Greathouse IV_, Jun 08 2016

%Y Cf. A061346, A000961, A005408, A061344, A075109, A075110.

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_, Jun 08 2001

%E More terms from Larry Reeves (larryr(AT)acm.org), Jun 12 2001