OFFSET
1,2
COMMENTS
Numbers n such that, if p^2 divides n for any prime p, then p = 1 mod 4.
Equivalently, squarefree numbers times A004613.
Different from A193304: terms 169, 289, 338, 507, 578, 841, 845, 867, ... are here but not in A193304. - Michel Marcus, Jun 20 2014
The asymptotic density of this sequence is 3/(8*K^2) = (3/4) * A243379 = 0.64208..., where K is the Landau-Ramanujan constant (A064533). - Amiram Eldar, Dec 19 2020
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
Joshua Harrington, Lenny Jones, and Alicia Lamarche, Representing Integers as the Sum of Two Squares in the Ring Z_n, arXiv:1404.0187 [math.NT], Apr 01 2014 and, J. Int. Seq. 17 (2014) # 14.7.4.
EXAMPLE
In Z_7, 0^2 + 0^2 = 0, 1^2 + 0^2 = 1, 1^2 + 1^2 = 2, 3^2 + 1^2 = 3, 2^2 + 0^2 = 4, 2^2 + 1^2 = 5, 3^2 + 2^2 = 6. Therefore 7 is in the sequence.
In Z_8, there is no way to express 3 as a sum of two squares. Therefore 8 is not in the sequence.
MATHEMATICA
rad[n_] := Times @@ First /@ FactorInteger[n];
a57521[n_] := n/Denominator[n/rad[n]^2];
a65338[n_] := a65338[n] = If[n==1, 1, Mod[p = FactorInteger[n][[1, 1]], 4]* a65338[n/p]];
Select[Range[200], a65338[a57521[#]] == 1&] (* Jean-François Alcover, Sep 22 2018, after Antti Karttunen *)
Select[Range[200], AllTrue[FactorInteger[#], Mod[First[#1], 4] == 1 || Last[#1] == 1 &] &] (* Amiram Eldar, Dec 19 2020 *)
PROG
(PARI) is(n)=my(f=factor(n)); for(i=1, #f~, if(f[i, 2]>1 && f[i, 1]%4>1, return(0))); 1
(PARI) isok(n) = { if (n < 2, return (0)); if ((n % 4) == 0, return (0)); forprime(q = 2, n, if (((q % 4) == 3) && ((n % q) == 0) && ((n % q^2) == 0), return (0)); ); return (1); } \\ Michel Marcus, Jun 08 2014
(Scheme)
;; With Antti Karttunen's IntSeq-library.
;; Antti Karttunen, Jun 21 2014
KEYWORD
nonn
AUTHOR
Charles R Greathouse IV, Apr 04 2014
STATUS
approved