OFFSET
1,2
COMMENTS
a(n) is odd if and only if n is odd or n == 2, 10 (mod 12).
a(n) = n^2 if and only if: (a) n is odd or n == 6 (mod 12), and n is squarefree; or (b) n is 4 times an odd squareefree number.
LINKS
Jianing Song, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n * rad(n) if n is odd or n == 6 (mod 12); (3/4) * n * rad(n) if n == 2, 10 (mod 12); 2 * n * rad(n) if n is divisible by 4, where rad = A007947.
PROG
(PARI) rad(n) = factorback(factorint(n)[, 1]);
a(n) = n*rad(n)*if(n%2 || n%12==6, 1, if(n%12==2 || n%12==10, 3/4, 2))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jianing Song, May 21 2022
STATUS
approved