A002035 Numbers that contain primes to odd powers only.
2, 3, 5, 6, 7, 8, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 24, 26, 27, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 46, 47, 51, 53, 54, 55, 56, 57, 58, 59, 61, 62, 65, 66, 67, 69, 70, 71, 73, 74, 77, 78, 79, 82, 83, 85, 86, 87, 88, 89, 91, 93, 94, 95, 96, 97, 101
Offset: 1
References
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
- Eckford Cohen, Quadratic congruences with an odd number of summands, Amer. Math. Monthly, 73 (1966), 138-143.
Programs
-
Haskell
a002035 n = a002035_list !! (n-1) a002035_list = filter (all odd . a124010_row) [1..] -- Reinhard Zumkeller, Nov 14 2012
-
Maple
isA002035 := proc(n) local pe; for pe in ifactors(n)[2] do if type(pe[2],'even') then return false; end if; end do: true ; end proc: A002035 := proc(n) option remember; if n =1 then 2; else for a from procname(n-1)+1 do if isA002035(a) then return a; end if; end do: end if; end proc: seq(A002035(n),n=1..100) ; # R. J. Mathar, Nov 27 2017
-
Mathematica
ok[n_] := And @@ OddQ /@ FactorInteger[n][[All, 2]]; Select[Range[2, 101], ok] (* Jean-François Alcover, Apr 22 2011 *) Select[Range[2,110],AllTrue[FactorInteger[#][[All,2]],OddQ]&] (* Harvey P. Dale, Nov 02 2022 *)
-
PARI
is(n)=Set(factor(n)[,2]%2)==[1] \\ Charles R Greathouse IV, Feb 07 2017
Extensions
More terms from Reinhard Zumkeller, Jun 23 2002
Comments