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

A347381 Distance from n to the nearest common ancestor of n and sigma(n) in the Doudna-tree (A005940).

Original entry on oeis.org

0, 0, 1, 1, 1, 0, 3, 2, 2, 3, 3, 2, 2, 3, 1, 3, 6, 3, 5, 1, 4, 5, 7, 2, 3, 4, 3, 0, 8, 4, 10, 4, 4, 7, 2, 4, 4, 7, 3, 4, 10, 4, 9, 4, 3, 9, 13, 4, 4, 4, 7, 7, 15, 4, 5, 5, 6, 9, 15, 4, 7, 10, 3, 5, 4, 6, 12, 6, 8, 5, 19, 5, 9, 6, 4, 8, 3, 5, 19, 4, 3, 11, 20, 4, 7, 11, 9, 6, 22, 4, 4, 8, 11, 15, 7, 5, 24, 5, 3, 5, 20
Offset: 1

Views

Author

Antti Karttunen, Aug 30 2021

Keywords

Comments

a(n) tells about the degree of relatedness between n and sigma(n) in Doudna tree (see the illustration in A005940). It is 0 for those n where sigma(n) is one of the descendants of n, 1 for those n where the nearest common ancestor of n and sigma(n) is the parent of n, 2 for those n where the nearest common ancestor of n and sigma(n) is the grandparent of n, and so on.

Crossrefs

Indices of 0 .. 5 in this sequence are given by {2} U A336702, A347391, A347392, A347393, A347394, A374465.
Cf. A000203, A027687, A156552, A252463, A252464, A332221, A347380, A347383, A347384, A347390, A374481 [a(prime(n))], A374482 (indices of records), A374483 (record values).
Cf. also A336834.

Programs

  • PARI
    A000523(n) = logint(n,2);
    Abincompreflen(x, y) = if(!x || !y, 0, my(xl=A000523(x), yl=A000523(y), s=min(xl,yl), k=0); x >>= (xl-s); y >>= (yl-s); while(s>=0 && !bitand(1,bitxor(x>>s,y>>s)), s--; k++); (k));
    A156552(n) = {my(f = factor(n), p, p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res}; \\ From A156552
    A061395(n) = if(n>1, primepi(vecmax(factor(n)[, 1])), 0);
    A252464(n) = if(1==n,0,(bigomega(n) + A061395(n) - 1));
    A347381(n) = (A252464(n)-Abincompreflen(A156552(n), A156552(sigma(n))));
    
  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A252463(n) = if(!(n%2),n/2,A064989(n));
    A347381(n) = if(1==n,0, my(lista=List([]), i, k=n, stemvec, stemlen, sbr=sigma(n)); while(k>1, listput(lista,k); k = A252463(k)); stemvec = Vecrev(Vec(lista)); stemlen = #stemvec; while(1, if((i=vecsearch(stemvec,sbr))>0, return(stemlen-i)); sbr = A252463(sbr)));

Formula

a(n) = A252464(n) - A347380(n), where A347380(n) is the length of the common prefix in binary expansions of A156552(n) and A332221(n) = A156552(sigma(n)).

Extensions

Name changed, old name is now in formula section. - Antti Karttunen, Jul 09 2024

A374481 The distance from prime(n) to the nearest common ancestor of prime(n) and 1+prime(n) in the Doudna-tree (A005940).

Original entry on oeis.org

0, 1, 1, 3, 3, 2, 6, 5, 7, 8, 10, 4, 10, 9, 13, 15, 15, 7, 12, 19, 9, 19, 20, 22, 24, 20, 21, 27, 26, 23, 30, 28, 25, 32, 34, 28, 15, 25, 36, 31, 39, 39, 41, 19, 41, 45, 31, 44, 42, 43, 46, 50, 52, 51, 42, 52, 55, 51, 25, 46, 41, 61, 61, 59, 28, 51, 44, 67, 60, 68, 55, 70, 64, 71, 69, 74, 73, 32, 61, 69, 79, 35, 82
Offset: 1

Views

Author

Antti Karttunen, Jul 09 2024

Keywords

Comments

Question: Is there any reasonable lower bound for this sequence?
Considering k that do not occur as terms of this sequence, see also A374214.

Crossrefs

Programs

  • PARI
    A374481(n) = A347381(prime(n));
    
  • PARI
    A241917(n) = if(isprime(n), primepi(n), if(1>=omega(n), 0, my(f=factor(n)); if(f[#f~,2]>1, 0, primepi(f[#f~,1])-primepi(f[(#f~)-1,1]))));
    A374481(n) = if(1==n,0,(-1+n-A241917(1+prime(n))));

Formula

a(n) = A347381(A000040(n)) = n - A348040(A000040(n), 1+A000040(n)).
For all n >= 1, a(A059305(n)) = A059305(n)-1.
If A319988(1+A000040(n)) then a(n) = n-1.
For n > 1, a(n) = n - A241917(1+prime(n)) - 1. - Peter Munn and Antti Karttunen, Jul 10 2024

A374483 Record values in A347381, where A347381 is the distance from n to the nearest common ancestor of n and sigma(n) in the Doudna-tree (A005940).

Original entry on oeis.org

0, 1, 3, 6, 7, 8, 10, 13, 15, 19, 20, 22, 24, 27, 30, 32, 34, 36, 39, 41, 45, 46, 50, 52, 55, 61, 67, 68, 70, 71, 74, 79, 82, 86, 87, 90, 94, 98, 103, 105, 106, 108, 111, 117, 121, 126, 134, 138, 144, 146, 149, 151, 162, 163, 169, 171, 174, 179, 189, 191, 192, 194, 200, 203, 204, 208, 212, 220, 221, 224, 226, 229, 231
Offset: 1

Views

Author

Antti Karttunen, Jul 09 2024

Keywords

Crossrefs

Formula

a(n) = A347381(A374482(n)).

A373464 Largest of a quadruple of primes p[1..4] such that (p[k]+1, k=1..4) is in geometric progression.

Original entry on oeis.org

23, 47, 107, 191, 499, 647, 719, 809, 863, 1249, 1439, 1999, 2591, 2879, 3023, 3779, 4079, 5323, 6911, 7039, 7127, 7559, 8231, 8231, 8747, 9839, 10289, 10289, 10499, 10499, 10529, 10691, 11279, 11519, 12959, 13229, 13309, 13999, 15551, 15551, 15971, 18143, 19207
Offset: 1

Views

Author

M. F. Hasler, Jul 12 2024

Keywords

Comments

a(10) = 1249 is the first term not in A299171, a(15) = 3023 is the first term not in A293194, a(17) = 4079 is the first term not in A347977 and also the first term not in A374482, and a(21) = 7127 is the first term not in A184856.

Examples

			The terms of the sequence are column "p[4]" in the following table which lists the sequences of primes, and ratios of the geometric progression (p[k]+1):
   n  | p[1], p[2], p[3], p[4]  |  r = (p[k+1]+1) / (p[k]+1)
------+-------------------------+---------------------------
   1  |    2,    5,   11,   23  |  2 = 6/3 = 12/6 = 24/12
   2  |    5,   11,   23,   47  |  2 = 12/6 = 24/12 = 48/24
   3  |   31,   47,   71,  107  |  3/2 = 48/32 = 72/48 = 108/72
   4  |    2,   11,   47,  191  |  4 = 12/3 = 48/12 = 192/48
   5  |   31,   79,  199,  499  |  5/2 = 80/32 = 200/80 = 500/200
   6  |    2,   17,  107,  647  |  6 = 18/3 = 108/18 = 648/108
   7  |   89,  179,  359,  719  |  2 = 180/90 = ...
   8  |   29,   89,  269,  809  |  3 = 90/30 = ...
   9  |  499,  599,  719,  863  |  6/5 = 600/500 = ...
  10  |   79,  199,  499, 1249  |  5/2 = 200/80 = ...
  11  |  179,  359,  719, 1439  |  2 = 360/180 = ...
  12  |   53,  179,  599, 1999  |  10/3 = 180/54 = ...
		

Crossrefs

Subsequence of A089199 (primes p such that p+1 is divisible by a cube).

Programs

  • PARI
    A373464_upto(N, show=0, D = 1, LIM=N\2) = { my(L=List()); forprime(p=1, LIM, my(denom = p+D); for(numer=denom+1, sqrtnint((N+D) * denom^2, 3), my(r=numer/denom); for(k=1,3, (type(denom * r^k)=="t_INT" && isprime(denom * r^k - D)) || next(2)); listput(L, denom * r^3 - D); show && printf(" | %4d, %4d, %4d, %4d | %s\n",denom-D, denom*r-D, denom*r^2-D, denom*r^3-D, numer/denom))); vecsort(L)}
    
  • Python
    from itertools import islice
    from fractions import Fraction
    from sympy import nextprime
    def A373464_gen(): # generator of terms
        p, plist, pset = 1, [], set()
        while True:
            p = nextprime(p)
            for q in plist:
                r = Fraction(q+1,p+1)
                q2 = r*(q+1)-1
                if q2 < 2:
                    break
                if q2.denominator == 1:
                    q2 = int(q2)
                    if q2 in pset:
                        q3 = r*(q2+1)-1
                        if q3 < 2:
                            break
                        if q3.denominator == 1 and int(q3) in pset:
                            yield p
            plist = [p]+plist
            pset.add(p)
    A373464_list = list(islice(A373464_gen(),20)) # Chai Wah Wu, Jul 16 2024

Extensions

a(26)-a(43) from Chai Wah Wu, Jul 16 2024
Showing 1-4 of 4 results.