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

A336118 a(n) = A335904(n) - A087436(n).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 3, 0, 3, 1, 1, 0, 2, 0, 4, 1, 1, 3, 5, 0, 2, 3, 0, 1, 5, 1, 3, 0, 3, 2, 2, 0, 7, 4, 3, 1, 5, 1, 7, 3, 1, 5, 7, 0, 2, 2, 2, 3, 7, 0, 4, 1, 4, 5, 9, 1, 7, 3, 1, 0, 4, 3, 8, 2, 5, 2, 6, 0, 10, 7, 2, 4, 4, 3, 7, 1, 0, 5, 9, 1, 3, 7, 5, 3, 8, 1, 4, 5, 3, 7, 5, 0, 5, 2, 3, 2, 8, 2, 8, 3, 2
Offset: 1

Views

Author

Antti Karttunen, Jul 09 2020

Keywords

Comments

Totally additive because both A087436 and A335904 are.

Crossrefs

Programs

Formula

a(n) = A335904(n) - A087436(n).
a(n) = A335904(A335915(n)).

A335915 Fully multiplicative with a(2) = 1, and a(p) = A000265(p-1)*A000265(p+1) = A000265(p^2 - 1), for odd primes p.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 3, 1, 1, 3, 15, 1, 21, 3, 3, 1, 9, 1, 45, 3, 3, 15, 33, 1, 9, 21, 1, 3, 105, 3, 15, 1, 15, 9, 9, 1, 171, 45, 21, 3, 105, 3, 231, 15, 3, 33, 69, 1, 9, 9, 9, 21, 351, 1, 45, 3, 45, 105, 435, 3, 465, 15, 3, 1, 63, 15, 561, 9, 33, 9, 315, 1, 333, 171, 9, 45, 45, 21, 195, 3, 1, 105, 861, 3, 27, 231, 105, 15, 495, 3, 63, 33, 15, 69
Offset: 1

Views

Author

Antti Karttunen, Jul 09 2020

Keywords

Comments

For all i, j: A324400(i) = A324400(j) => a(i) = a(j) => A336118(i) = A336118(j).

Crossrefs

Programs

  • PARI
    A000265(n) = (n>>valuation(n,2));
    A335915(n) = { my(f=factor(n)); prod(k=1,#f~,if(2==f[k,1],1,(A000265(f[k,1]-1)*A000265(f[k,1]+1))^f[k,2])); };

Formula

Completely multiplicative with a(2) = 1, and for odd primes p, a(p) = A000265(p-1)*A000265(p+1).
For all n >= 1, A335904(a(n)) = A336118(n).
For all n >= 0, a(2^n) = a(3^n) = 1, a(5^n) = a(7^n) = 3^n.
a(n) = A336466(n) * A336467(n). - Antti Karttunen, Jan 31 2021

A335885 The length of a shortest path from n to a power of 2, when applying the nondeterministic maps k -> k - k/p and k -> k + k/p, where p can be any of the odd prime factors of k, and the maps can be applied in any order.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 29 2020

Keywords

Comments

The length of a shortest path from n to a power of 2, when using the transitions x -> A171462(x) and x -> A335876(x) in any order.
a((2^e)-1) is equal to A046051(e) = A001222((2^e)-1) when e is either a Mersenne exponent (in A000043), or some other number: 1, 4, 6, 8, 16, 32. For example, 32 is present because 2^32 - 1 = 4294967295 = 3*5*17*257*65537, a squarefree product of five known Fermat primes. - Antti Karttunen, Aug 11 2020

Examples

			A335876(67) = 68, and A171462(68) = 64 = 2^6, and this is the shortest path from 67 to a power of 2, thus a(67) = 2.
A171462(15749) = 15748, A335876(15748) = 15872, A335876(15872) = 16384 = 2^14, and this is the shortest path from 15749 to a power of 2, thus a(15749) = 3.
		

Crossrefs

Cf. A000079, A335911, A335912 (positions of 0's, 1's and 2's in this sequence) and array A335910.

Programs

  • PARI
    A335885(n) = { my(f=factor(n)); sum(k=1,#f~,if(2==f[k,1],0,f[k,2]*(1+min(A335885(f[k,1]-1),A335885(f[k,1]+1))))); };
    
  • PARI
    \\ Or empirically as:
    A171462(n) = if(1==n,0,(n-(n/vecmax(factor(n)[, 1]))));
    A335876(n) = if(1==n,2,(n+(n/vecmax(factor(n)[, 1]))));
    A209229(n) = (n && !bitand(n,n-1));
    A335885(n) = if(A209229(n),0,my(xs=Set([n]),newxs,a,b,u); for(k=1,oo, newxs=Set([]); for(i=1,#xs,u = xs[i]; a = A171462(u); if(A209229(a), return(k)); b = A335876(u); if(A209229(b), return(k)); newxs = setunion([a],newxs); newxs = setunion([b],newxs)); xs = newxs));

Formula

Fully additive with a(2) = 0, and a(p) = 1+min(a(p-1), a(p+1)), for odd primes p.
For all n >= 1, a(n) <= A335875(n) <= A335881(n) <= A335884(n) <= A335904(n).
For all n >= 0, a(A000244(n)) = n, and these also seem to give records.

A335884 The length of a longest path from n to a power of 2, when applying the nondeterministic maps k -> k - k/p and k -> k + k/p, where p can be any of the odd prime factors of k, and the maps can be applied in any order.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 29 2020

Keywords

Comments

The length of a longest path from n to a power of 2, when using the transitions x -> A171462(x) and x -> A335876(x).

Crossrefs

Cf. A335883 (position of the first occurrence of each n).

Programs

  • PARI
    A335884(n) = { my(f=factor(n)); sum(k=1,#f~,if(2==f[k,1],0,f[k,2]*(1+max(A335884(f[k,1]-1),A335884(f[k,1]+1))))); };
    
  • PARI
    \\ Or empirically as:
    A171462(n) = if(1==n,0,(n-(n/vecmax(factor(n)[, 1]))));
    A335876(n) = if(1==n,2,(n+(n/vecmax(factor(n)[, 1]))));
    A209229(n) = (n && !bitand(n,n-1));
    A335884(n) = if(A209229(n),0,my(xs=Set([n]),newxs,a,b,u); for(k=1,oo, newxs=Set([]); if(!#xs, return(k-1)); for(i=1,#xs,u = xs[i]; a = A171462(u); if(!A209229(a), newxs = setunion([a],newxs)); b = A335876(u); if(!A209229(b), newxs = setunion([b],newxs))); xs = newxs));

Formula

Fully additive with a(2) = 0, and a(p) = 1+max(a(p-1), a(p+1)), for odd primes p.
For all n >= 1, A335904(n) >= a(n) >= A335881(n) >= A335875(n) >= A335885(n).
For all n >= 0, a(A335883(n)) = n.

A335875 a(n) = min(A329697(n), A331410(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 29 2020

Keywords

Examples

			A329697(67) = A331410(67) = 4, thus a(67) = min(4,4) = 4.
A329697(15749) = 9 and A331410(15749) = 10, thus a(15749) = 9.
		

Crossrefs

Programs

Formula

a(n) = min(A329697(n), A331410(n)).
For all n >= 1, A335904(n) >= A335884(n) >= A335881(n) >= a(n) >= A335885(n).

A335881 a(n) = max(A329697(n), A331410(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 29 2020

Keywords

Crossrefs

Cf. A329662 (apparently the positions of records).

Programs

Formula

a(n) = max(A329697(n), A331410(n)).
For all n >= 1, A335904(n) >= A335884(n) >= a(n) >= A335875(n) >= A335885(n).

A335905 Number of distinct integers encountered on all possible paths from n to any first encountered powers of 2 (that are excluded from the count), when using the transitions x -> x - (x/p) and x -> x + (x/p) in any order, where p is the largest prime dividing x.

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 2, 0, 3, 2, 3, 1, 3, 2, 4, 0, 4, 3, 5, 2, 4, 3, 4, 1, 6, 3, 6, 2, 6, 4, 5, 0, 5, 4, 6, 3, 6, 5, 5, 2, 6, 4, 7, 3, 7, 4, 5, 1, 6, 6, 7, 3, 9, 6, 7, 2, 8, 6, 7, 4, 6, 5, 7, 0, 7, 5, 7, 4, 6, 6, 7, 3, 7, 6, 9, 5, 8, 5, 7, 2, 10, 6, 7, 4, 9, 7, 9, 3, 10, 7, 7, 4, 8, 5, 11, 1, 7, 6, 8, 6, 11, 7, 10, 3, 9
Offset: 1

Views

Author

Antti Karttunen, Jun 30 2020

Keywords

Examples

			From 9 one can reach with the transitions x -> A171462(x) (leftward arrow) and x -> A335876(x) (rightward arrow) the following three numbers, when one doesn't expand any power of 2 (in this case, 4, 8 and 16, that are not included in the count) further:
       9
      / \
     6   12
    / \ / \
  (4) (8) (16)
thus a(9) = 3.
From 10 one can reach with the transitions x -> A171462(x) and x -> A335876(x) the following two numbers (10 & 12), when one doesn't expand any powers of 2 (8 and 16 in this case, not counted) further:
  10
   |\
   | \
   | 12
   | /\
   |/  \
  (8)  (16)
thus a(10) = 2.
For n = 9, the numbers encountered are 6, 9, 12, thus a(9) = 3.
For n = 67, the numbers encountered are 48, 60, 66, 67, 68, 72, 96, thus a(67) = 7.
For n = 105, the numbers encountered are 48, 72, 90, 96, 105, 108, 120, 144, 192, thus a(105) = 9.
		

Crossrefs

Programs

  • PARI
    A171462(n) = if(1==n,0,(n-(n/vecmax(factor(n)[, 1]))));
    A335876(n) = if(1==n,2,(n+(n/vecmax(factor(n)[, 1]))));
    A209229(n) = (n && !bitand(n,n-1));
    A335905(n) = if(A209229(n),0,my(xs=Set([n]),allxs=xs,newxs,a,b,u); for(k=1,oo, newxs=Set([]); if(!#xs, return(#allxs)); allxs = setunion(allxs,xs); for(i=1,#xs,u = xs[i]; a = A171462(u); if(!A209229(a), newxs = setunion([a],newxs)); b = A335876(u); if(!A209229(b), newxs = setunion([b],newxs))); xs = newxs));

A336161 Lexicographically earliest infinite sequence such that a(i) = a(j) => A087436(i) = A087436(j) and A335915(i) = A335915(j) for all i, j >= 1.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 6, 3, 7, 1, 8, 4, 9, 3, 7, 5, 10, 2, 11, 6, 12, 3, 13, 7, 5, 1, 14, 8, 11, 4, 15, 9, 16, 3, 13, 7, 17, 5, 18, 10, 19, 2, 11, 11, 11, 6, 20, 12, 21, 3, 21, 13, 22, 7, 23, 5, 18, 1, 24, 14, 25, 8, 26, 11, 27, 4, 28, 15, 29, 9, 21, 16, 30, 3, 31, 13, 32, 7, 33, 17, 34, 5, 35, 18, 24, 10, 14, 19, 36, 2, 37, 11, 38, 11, 39, 11, 40, 6, 29
Offset: 1

Views

Author

Antti Karttunen, Jul 10 2020

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A087436(n), A335915(n)].
For all i, j: A324400(i) = A324400(j) => a(i) = a(j) => A335904(i) = A335904(j).

Crossrefs

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A087436(n) = (bigomega(n>>valuation(n,2)));
    A000265(n) = (n>>valuation(n,2));
    A335915(n) = { my(f=factor(n)); prod(k=1,#f~,if(2==f[k,1],1,(A000265(f[k,1]-1)*A000265(f[k,1]+1))^f[k,2])); };
    Aux336161(n) = [A087436(n),A335915(n)];
    v336161 = rgs_transform(vector(up_to, n, Aux336161(n)));
    A336161(n) = v336161[n];
Showing 1-8 of 8 results.