A214324 Records in A214323.
1, 2, 3, 7, 8, 11, 36, 415, 1229, 2545, 16721, 82940, 85992, 128925
Offset: 1
Extensions
a(12) from Reinhard Zumkeller, Jul 24 2012
a(13)-a(14) from Jinyuan Wang, Jul 25 2021
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.
The runs of ones in A214323 are: (1, 1, 1, 1, 1, 1), 2,() 3,() 2,() 3,() 2, (1, 1, 1, 1), 7,() 3,() 2,() 3,() 4, (1, 1, 1, 1, 1, 1), 4, (1), 5, (1, 1, 1, 1), 8, (1), 2, (1), 6, (1), 4,() 5,() 4, ... Giving the terms: 6, 0, 0, 0, 0, 4, 0, 0, 0, 0, 6, 1, 4, 1, 1, 1, 0, 0, ... Similarly the runs of consecutive numbers in A214653 are: (0, 1, 2, 3, 4, 5), (11, 12, 13, 14), (20, 21, 22, 23, 24, 25), (27), (29, 30, 31, 32), (34), (36), (38), ...
import math a3 = a2 = a1 = 1 last_position = 0 run_lengths = [] for position in range(4, 20000): gcd = math.gcd(a1, a3) if gcd > 1: run_length = position - last_position - 1 run_lengths.append(run_length) last_position = position a3, a2, a1 = a2, a1, (a1 + a3) // gcd print(run_lengths)
a(14)=9, a(16)=3, therefore a(17)=(9+3)/gcd(9,3) = 12/3 = 4. a(24)=28, a(26)=60, therefore a(27)=(28+60)/gcd(28,60) = 88/4 = 22.
a214551 n = a214551_list !! n a214551_list = 1 : 1 : 1 : zipWith f a214551_list (drop 2 a214551_list) where f u v = (u + v) `div` gcd u v -- Reinhard Zumkeller, Jul 23 2012
a:= proc(n) a(n):= `if`(n<3, 1, (a(n-1)+a(n-3))/igcd(a(n-1), a(n-3))) end: seq(a(n), n=0..100); # Alois P. Heinz, Oct 18 2012
t = {1, 1, 1}; Do[AppendTo[t, (t[[-1]] + t[[-3]])/GCD[t[[-1]], t[[-3]]]], {100}] f[l_List] := Append[l, (l[[-1]] + l[[-3]])/GCD[l[[-1]], l[[-3]]]]; Nest[f, {1, 1, 1}, 62] (* Robert G. Wilson v, Jul 23 2012 *) RecurrenceTable[{a[0]==a[1]==a[2]==1,a[n]==(a[n-1]+a[n-3])/GCD[ a[n-1], a[n-3]]},a,{n,70}] (* Harvey P. Dale, May 06 2014 *)
first(n)=my(v=vector(n+1)); for(i=1,min(n,3),v[i]=1); for(i=4,#v, v[i]=(v[i-1]+v[i-3])/gcd(v[n-1],v[i-3])); v \\ Charles R Greathouse IV, Jun 21 2017
use bignum; my @seq = (1, 1, 1); print "1 1\n2 1\n3 1\n"; for ( my $i = 3; $i < 400; $i++ ) { my $next = ( $seq[$i-1] + $seq[$i-3] ) / gcd( $seq[$i-1], $seq[$i-3] ); my $ind = $i+1; print "$ind $next\n"; push( @seq, $next ); } sub gcd { my ($x, $y) = @_; ($x, $y) = ($y, $x % $y) while $y; return $x; }
from math import gcd def aupton(nn): alst = [1, 1, 1] for n in range(3, nn+1): alst.append((alst[n-1] + alst[n-3])//gcd(alst[n-1], alst[n-3])) return alst print(aupton(64)) # Michael S. Branicky, Mar 28 2022
def A214551Rec(): x, y, z = 1, 1, 1 yield x while True: x, y, z = y, z, (z + x)//gcd(z, x) yield x A214551 = A214551Rec(); print([next(A214551) for in range(65)]) # _Peter Luschny, Oct 18 2012
a214322 n = a214322_list !! n a214322_list = 1 : 1 : 1 : zipWith (+) a214551_list (drop 2 a214551_list) -- Reinhard Zumkeller, Jul 24 2012
import Data.List (elemIndices) a214653 n = a214653_list !! (n-1) a214653_list = elemIndices 1 a214323_list
Comments