A056926 a(n) = sqrt(n) if n is a square, otherwise 1.
0, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1, 1, 1, 1
Offset: 0
Examples
a(24) = 1 because 24 is not a square, a(25) = 5 because 25 = 5^2.
Links
- Antti Karttunen, Table of n, a(n) for n = 0..65537
Programs
-
Mathematica
sq1[n_]:=Module[{sn=Sqrt[n]},If[IntegerQ[sn],sn,1]]; Array[sq1,110] (* Harvey P. Dale, Jul 25 2011 *)
-
PARI
A056926(n) = if(issquare(n,&n),n,1); \\ Antti Karttunen, Jul 22 2018
Formula
a(n) = n^((d(n) mod 2)/2) for n>=1. - Wesley Ivan Hurt, Jun 07 2023
Extensions
Term a(0) = 0 prepended by Antti Karttunen, Jul 22 2018
Comments