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.

A214228 a(n) = gcd(r,2*n+1) where r is 1 + (A143608(i-1) mod (2*n+1)) and A143608(i) is the first zero mod 2*n+1 other than i=0.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 5, 1, 1, 7, 1, 1, 1, 1, 1, 1, 7, 1, 13, 1, 1, 5, 1, 1, 3, 1, 5, 1, 1, 1, 7, 1, 1, 23, 1, 1, 25, 7, 1, 1, 1, 5, 29, 1, 7, 31, 5, 1, 1, 1, 1, 35, 1, 1, 37, 1, 23, 13, 7, 1, 41, 1, 1, 1, 1, 7, 5, 1, 1, 47, 13, 1, 49, 1, 1, 9, 31, 1, 53
Offset: 1

Views

Author

Kenneth J Ramsey, Jul 07 2012

Keywords

Comments

It appears that a(n) * gcd(s,2*n+1) is either 2*n+1 or 1; where s is 1 + (A143608(i+1) mod (2*n+1)) and A143608(i) is as stated in the definition.

Examples

			a(7) = 5 which is a factor of 2*7+1.
		

Crossrefs

Cf. A143608.

Programs

  • Maple
    A214228 := proc(n)
        local i,r ;
        i := 1;
        while A143608(i) mod (2*n+1) <> 0 do
            i := i+1 ;
        end do;
        r := 1+(A143608(i-1) mod (2*n+1)) ;
        gcd(r,2*n+1) ;
    end proc: # R. J. Mathar, Jul 22 2012
  • Mathematica
    gcdN1[x_,y_] = GCD[x + 1,y]; r0 = 3; Reap[While[r0 < 200, s1=1; s0=0; count=1; While[True, count++; temp=Mod[4*s1 - s0, r0]; If[temp==0, Break[]]; count++; s0 = s1; s1 = temp; temp=Mod[2*s1-s0,r0]; If[temp == 0, Break[]]; s0 = s1; s1 = temp;]; Sow[gcdN1[s1, r0], c]; r0+=2;]][[2,1]]