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.

Showing 1-3 of 3 results.

A132468 Longest gap between numbers relatively prime to n.

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 3, 2, 1, 1, 3, 1, 3, 2, 3, 1, 3, 1, 3, 1, 3, 1, 5, 1, 1, 2, 3, 2, 3, 1, 3, 2, 3, 1, 5, 1, 3, 2, 3, 1, 3, 1, 3, 2, 3, 1, 3, 2, 3, 2, 3, 1, 5, 1, 3, 2, 1, 2, 5, 1, 3, 2, 5, 1, 3, 1, 3, 2, 3, 2, 5, 1, 3, 1, 3, 1, 5, 2, 3, 2, 3, 1, 5, 2, 3, 2, 3, 2, 3, 1, 3, 2, 3, 1, 5, 1, 3, 4
Offset: 1

Views

Author

Michael Kleber, Nov 16 2007

Keywords

Comments

Here "gap" does not include the endpoints.
a(n) is given by the maximum length of a run of numbers satisfying one congruence modulo each of n's distinct prime factors. It follows that if m is the number of distinct prime factors of n and each of n's prime factors is greater than m then a(n) = m. - Thomas Anton, Dec 30 2018

Examples

			E.g. n=3: the longest gap in 1, 2, 4, 5, 7, ... is 1, between 2 and 4, so a(3) = 1.
		

Crossrefs

Equals A048669(n) - 1.

Programs

  • Maple
    a:=[];
    for n from 1 to 120 do
    s:=[seq(j,j=1..4*n)];
    rec:=0;
       for st from 1 to n do
       len:=0;
        for i from 1 to n while gcd(s[st+i-1],n)>1 do len:=len+1; od:
        if len>rec then rec:=len; fi;
       od:
    a:=[op(a),rec];
    od:
    a; # N. J. A. Sloane, Apr 18 2017
  • Mathematica
    a[ n_ ] := (Max[ Drop[ #,1 ]-Drop[ #,-1 ] ]-1&)[ Select[ Range[ n+1 ],GCD[ #,n ]==1& ] ]
    Do[Print[n, " ", a[n]],{n,20000}]

Formula

a(n) = 1 at every prime power.

Extensions

Incorrect formula removed by Thomas Anton, Dec 30 2018

A070790 Integers n such that the 'Reverse and Add!' trajectory of n joins the trajectory of 3.

Original entry on oeis.org

3, 6, 12, 15, 21, 24, 30, 33, 39, 42, 48, 51, 57, 60, 66, 69, 75, 78, 84, 87, 93, 96, 132, 159, 165, 177, 219, 231, 258, 264, 276, 318, 330, 357, 363, 375, 417, 429, 456, 462, 474, 516, 528, 555, 561, 573, 579, 615, 627, 654, 660, 672, 678, 699, 714, 726, 753
Offset: 1

Views

Author

Klaus Brockhaus, May 07 2002

Keywords

Examples

			The trajectory of 6 is part of the trajectory of 3; the trajectory of 375 joins the trajectory of 3 at 9768 after 3 steps.
		

Crossrefs

Programs

  • Mathematica
    limit = 10^3; x = NestList[ # + IntegerReverse[#] &, 3, limit];
    Select[Range[753],
     Intersection[NestList[ # + IntegerReverse[#] &, #, limit],
    x] != {} &] (* Robert Price, Oct 20 2019 *)

A070792 Integers n such that the 'Reverse and Add!' trajectory of n joins the trajectory of 7.

Original entry on oeis.org

7, 14, 19, 23, 28, 29, 32, 37, 38, 41, 46, 47, 49, 50, 55, 56, 58, 64, 65, 67, 73, 74, 76, 82, 83, 85, 89, 91, 92, 94, 98, 110, 121, 136, 143, 187, 220, 235, 242, 286, 334, 341, 385, 433, 440, 484, 532, 569, 583, 631, 668, 682, 719, 730, 767, 781, 818, 866, 869
Offset: 1

Views

Author

Klaus Brockhaus, May 07 2002

Keywords

Examples

			The trajectory of 14 is part of the trajectory of 7; the trajectory of 235 joins the trajectory of 7 at 8872688 after 13 steps.
		

Crossrefs

Programs

  • Mathematica
    limit = 10^3; x = NestList[ # + IntegerReverse[#] &, 7, limit];
    Select[Range[869],
     Intersection[NestList[ # + IntegerReverse[#] &, #, limit],
    x] != {} &] (* Robert Price, Oct 20 2019 *)
Showing 1-3 of 3 results.