login
Nonprime numbers squared.
18

%I #24 Oct 14 2020 10:15:24

%S 1,16,36,64,81,100,144,196,225,256,324,400,441,484,576,625,676,729,

%T 784,900,1024,1089,1156,1225,1296,1444,1521,1600,1764,1936,2025,2116,

%U 2304,2401,2500,2601,2704,2916,3025,3136,3249,3364,3600,3844,3969,4096,4225

%N Nonprime numbers squared.

%H Harry J. Smith, <a href="/A062312/b062312.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A018252(n)^2. - _Omar E. Pol_, Oct 30 2007

%F Sum_{n>=1} 1/a(n) = A275647. - _Amiram Eldar_, Oct 14 2020

%t Select[Range[100],!PrimeQ[#]&]^2 (* _Harvey P. Dale_, Jan 27 2016 *)

%o (PARI) for(n=1,30, if(isprime(n), n+1,print(n^2)))

%o (PARI) n=0; for (m=1, 2000, if (!isprime(m), write("b062312.txt", n++, " ", m^2); if (n==1000, break))) \\ _Harry J. Smith_, Aug 04 2009

%o (PARI) is(n)=issquare(n,&n) && !isprime(n) \\ _Charles R Greathouse IV_, Sep 18 2015

%Y Cf. A002808, A018252, A275647.

%K easy,nonn

%O 1,2

%A _Jason Earls_, Jul 05 2001

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