cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A056926 a(n) = sqrt(n) if n is a square, otherwise 1.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Jul 12 2000

Keywords

Comments

Like A037213, but has 1's instead of 0's for nonsquare n > 0. - Antti Karttunen, Jul 22 2018

Examples

			a(24) = 1 because 24 is not a square, a(25) = 5 because 25 = 5^2.
		

Crossrefs

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) = A007955(n)/A056925(n) = 1 + (sqrt(n)-1)*A010052(n), for all n >= 1.
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