login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A255849 Characteristic function of pentagonal numbers. 2
1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0
COMMENTS
Pentagonal numbers are of the form (3*n^2-n)/2.
LINKS
FORMULA
For n > 0, a(n) = floor(sqrt(2*n/3+1/36)+1/6)-floor(sqrt(2*(n-1)/3+1/36)+1/6).
MATHEMATICA
Join[{1}, Table[If[IntegerQ[(1+Sqrt[1+24n])/6], 1, 0], {n, 100}]] (* Harvey P. Dale, Feb 25 2018 *)
Module[{nn=20, n5}, n5=PolygonalNumber[5, Range[0, nn]]; Table[If[MemberQ[ n5, n], 1, 0], {n, 0, n5[[-1]]}]] (* Harvey P. Dale, Dec 30 2021 *)
PROG
(PARI) a(n) = ispolygonal(n, 5); \\ Michel Marcus, Aug 04 2023
CROSSREFS
Sequence in context: A012245 A256436 A253903 * A185059 A179776 A360130
KEYWORD
nonn
AUTHOR
Mikael Aaltonen, Mar 08 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)