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.

A169695 a(n) = 1 if n is a square, otherwise a(n) = 2.

Original entry on oeis.org

1, 1, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2
Offset: 0

Views

Author

N. J. A. Sloane, Apr 15 2010

Keywords

Comments

Also number of central divisors of n, if n >= 1. - Omar E. Pol, Feb 10 2011.
Length of n-th row in the array of A207375, if n >= 1. - Omar E. Pol, Feb 27 2012

Crossrefs

Programs

  • Mathematica
    Array[2 - Boole[IntegerQ@ Sqrt@ #] &, 105, 0] (* Michael De Vlieger, Nov 03 2017 *)
  • PARI
    a(n) = 2 - issquare(n); \\ Amiram Eldar, Apr 17 2024

Formula

From Omar E. Pol, Feb 10 2011: (Start)
a(n) = 2 - A010052(n).
a(n) = 1 + A049240(n), n >=1.
a(n) = A000005(n)-A161840(n), n >= 1. (End)