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-2 of 2 results.

A354903 Lexicographically earliest infinite sequence of distinct positive integers such that the number of divisors of a(n+1) is prime to a(n).

Original entry on oeis.org

1, 2, 4, 9, 3, 5, 6, 16, 25, 7, 8, 36, 64, 49, 10, 100, 121, 11, 12, 81, 13, 14, 144, 625, 15, 17, 18, 729, 19, 20, 169, 21, 22, 196, 225, 23, 24, 1024, 256, 289, 26, 324, 1296, 2401, 27, 29, 28, 361, 30, 4096, 400, 441, 31, 32, 484, 529, 33, 34, 576, 5184
Offset: 1

Views

Author

David James Sycamore, Jun 11 2022

Keywords

Comments

1,2 are the earliest consecutive pair of numbers satisfying the definition, therefore the sequence begins with a(1)=1, a(2)=2.
The sequence is infinite since there is always a number k prime to a(n), and the smallest number not yet used which has k divisors could be a(n+1), unless there is a smaller number with the same property.
All record terms are squares, though not in ascending order (64 occurs before 49, 100 before 81, etc.).
Conjectured to be a permutation of the positive integers in which primes appear in natural order.

Examples

			a(7)=6 and 16 is the smallest number which has not already occurred whose number of divisors (5) is prime to 6, therefore a(8)=16.
		

Crossrefs

Programs

  • C
    // See Links section.
  • PARI
    lista(nn) = my(va = vector(nn)); va[1] = 1; for (n=2, nn, my(k=1); while ((gcd(va[n-1], numdiv(k)) != 1) || #select(x->(x==k), va), k++); va[n] = k;); va; \\ Michel Marcus, Jun 11 2022
    
  • Python
    from math import gcd
    from sympy import divisor_count
    from itertools import count, islice
    def agen(): # generator of terms
        aset, k, mink = {1}, 1, 2; yield 1
        for n in count(2):
            an, k = k, mink
            while k in aset or not gcd(an, divisor_count(k)) == 1: k += 1
            aset.add(k); yield k
            while mink in aset: mink += 1
    print(list(islice(agen(), 60))) # Michael S. Branicky, Jun 11 2022
    

Extensions

a(15) and beyond from Michael S. Branicky, Jun 11 2022

A349323 a(1)=1, a(2)=2, a(3)=4. Thereafter, for n>=3, a(n+1) is the smallest unused k such that d(k) is prime to both d(a(n)) and d(a(n-2)), but not to d(a(n-1)), where d is the divisor counting (tau) function A000005.

Original entry on oeis.org

1, 2, 4, 3, 9, 5, 25, 6, 36, 7, 49, 8, 100, 10, 121, 11, 144, 13, 16, 14, 81, 12, 625, 15, 1296, 17, 324, 19, 169, 21, 196, 22, 225, 23, 256, 24, 289, 26, 361, 27, 400, 29, 441, 30, 484, 31, 529, 33, 576, 34, 64, 35, 729, 18, 5184, 20, 2401, 28, 10000, 32, 11664
Offset: 1

Views

Author

David James Sycamore, Dec 22 2021

Keywords

Comments

Permutation of the positive integers, a "Yellowstone" version of A350150, having similar characteristics to the latter. The sequence interleaves squares a(2n+1) having odd tau with nonsquares a(2n) having even tau. Numbers with the same tau appear in their natural order (primes, squares, etc).

Examples

			a(1)=1, a(2)=2, a(3)=4, with number of divisors 1,2,3 respectively.
a(4) must be 3 because d(3)=2, which is prime to d(a(3))=d(4)=3 and to d(a(1))=d(1)=1 but it is not prime to d(a(2))=d(2)=2, and 3 is the least unused number with this property.
		

Crossrefs

Programs

  • Mathematica
    Nest[Block[{a = #1, i = #2, j = #3, k = #4, m = 3}, While[Nand[FreeQ[a, m], CoprimeQ[#, i], ! CoprimeQ[#, j], CoprimeQ[#, k]] &@DivisorSigma[0, m], m++]; Append[#1, m]] & @@ Join[{#}, DivisorSigma[0, #[[-3 ;; -1]]]] &, {1, 2, 4}, 58]  (* Michael De Vlieger, Jan 15 2022 *)
  • PARI
    isok(k, ndx, ndy, ndz, set) = {if (!setsearch(set, k), my(ndk=numdiv(k)); (gcd(ndx,ndk)==1) && (gcd(ndy,ndk)!=1) && (gcd(ndz,ndk)==1););}
    lista(nn) = {my(x=1, y=2, z=4, list=List([x,y,z]), set = Set(list)); for (n=4, nn, my(k=1, ndx=numdiv(x), ndy=numdiv(y), ndz=numdiv(z)); while (!isok(k, ndx, ndy, ndz, set), k++); listput(list, k); set = Set(list); x=y; y=z; z=k;); Vec(list);} \\ Michel Marcus, Jan 16 2022

Extensions

More terms from Michael De Vlieger, Dec 24 2021
Showing 1-2 of 2 results.