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!)
A296209 a(n) = 1 if n is a pentanacci number, 0 otherwise; characteristic function for A001591. 2
1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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
LINKS
MATHEMATICA
With[{pn=LinearRecurrence[{1, 1, 1, 1, 1}, {0, 0, 0, 0, 1}, 15]}, Table[ If[ MemberQ[ pn, n], 1, 0], {n, 0, 150}]] (* Harvey P. Dale, Aug 08 2021 *)
PROG
(PARI) A296209(n) = { if(n<=1, return(1)); my(p0=0, p1=0, p2=0, p3=1, p4=1, old_p0); while(n>p4, old_p0=p0; p0=p1; p1=p2; p2=p3; p3=p4; p4=old_p0+p0+p1+p2+p3; ); (n==p4); }
(Scheme)
(define (A296209 n) (let loop ((i 3)) (if (< (A001591 i) n) (loop (+ 1 i)) (if (= (A001591 i) n) 1 0))))
;; This uses memoization-macro definec:
(definec (A001591 n) (cond ((<= n 3) 0) ((= 4 n) 1) (else (+ (A001591 (- n 1)) (A001591 (- n 2)) (A001591 (- n 3)) (A001591 (- n 4)) (A001591 (- n 5))))))
CROSSREFS
Sequence in context: A266178 A339653 A255738 * A076141 A011751 A341540
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 22 2017
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 23 06:58 EDT 2024. Contains 371906 sequences. (Running on oeis4.)