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.

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.

A335430 Square array where row n lists all numbers k for which A331410(k) = n, read by falling antidiagonals.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 8, 7, 9, 15, 16, 12, 10, 17, 25, 32, 14, 11, 19, 29, 73, 64, 24, 13, 27, 37, 75, 125, 128, 28, 18, 30, 45, 85, 145, 365, 256, 31, 20, 33, 50, 87, 149, 375, 625, 512, 48, 21, 34, 51, 89, 173, 425, 725, 1249, 1024, 56, 22, 35, 53, 95, 185, 435, 745, 1489, 3125, 2048, 62, 23, 38, 55, 101, 219, 445, 841, 1825, 3625, 6245
Offset: 0

Views

Author

Antti Karttunen, Jun 28 2020

Keywords

Comments

Array is read by descending antidiagonals with (n,k) = (0,0), (0,1), (1,0), (0,2), (1,1), (2,0), ... where A(n,k) is the (k+1)-th solution x to A331410(x) = n. The row indexing (n) starts from 0, and column indexing (k) also from 0.
For any odd prime p that appears on row n, p+1 appears on row n-1.
The e-th powers of the terms on row n form a subset of terms on row (e*n). More generally, a product of terms that occur on rows i_1, i_2, ..., i_k can be found at row (i_1 + i_2 + ... + i_k), because A331410 is completely additive.

Examples

			The top left corner of the array:
  n\k |    0     1     2     3     4     5     6     7     8     9
------+----------------------------------------------------------------
   0  |    1,    2,    4,    8,   16,   32,   64,  128,  256,  512, ...
   1  |    3,    6,    7,   12,   14,   24,   28,   31,   48,   56, ...
   2  |    5,    9,   10,   11,   13,   18,   20,   21,   22,   23, ...
   3  |   15,   17,   19,   27,   30,   33,   34,   35,   38,   39, ...
   4  |   25,   29,   37,   45,   50,   51,   53,   55,   57,   58, ...
   5  |   73,   75,   85,   87,   89,   95,  101,  109,  111,  113, ...
   6  |  125,  145,  149,  173,  185,  219,  225,  250,  255,  261, ...
   7  |  365,  375,  425,  435,  445,  447,  449,  475,  493,  499, ...
   8  |  625,  725,  745,  841,  865,  925,  997, 1009, 1073, 1095, ...
   9  | 1249, 1489, 1825, 1875, 1993, 2017, 2117, 2125, 2175, 2225, ...
etc.
		

Crossrefs

Cf. A331410.
Cf. A329662 (the leftmost column), A000079, A335431, A335882 (rows 0, 1 and 2).
Cf. also A334100 (an analogous array for the map k -> k - k/p), and A335910.

Programs

  • PARI
    up_to = 78-1; \\ = binomial(12+1,2)-1
    memoA331410 = Map();
    A331410(n) = if(1==n,0,my(v=0); if(mapisdefined(memoA331410,n,&v), v, my(f=factor(n)); v = sum(k=1,#f~,if(2==f[k,1],0,f[k,2]*(1+A331410(f[k,1]+1)))); mapput(memoA331410,n,v); (v)));
    memoA335430sq = Map();
    A335430sq(n, k) = { my(v=0); if((0==k), v = -1, if(!mapisdefined(memoA335430sq,[n,k-1],&v), v = A335430sq(n, k-1))); for(i=1+v,oo,if(A331410(1+i)==n,mapput(memoA335430sq,[n,k],i); return(1+i))); };
    A335430list(up_to) = { my(v = vector(1+up_to), i=0); for(a=0,oo, for(col=0,a, i++; if(i > #v, return(v)); v[i] = A335430sq(col,(a-(col))))); (v); };
    v335430 = A335430list(up_to);
    A335430(n) = v335430[1+n];
    for(n=0,up_to,print1(A335430(n),", "));

A335912 Numbers k for which A335885(k) = 2.

Original entry on oeis.org

9, 11, 13, 15, 18, 19, 21, 22, 23, 25, 26, 29, 30, 35, 36, 38, 41, 42, 44, 46, 47, 49, 50, 51, 52, 58, 60, 61, 67, 70, 72, 76, 79, 82, 84, 85, 88, 92, 93, 94, 97, 98, 100, 102, 104, 113, 116, 119, 120, 122, 134, 137, 140, 144, 152, 155, 158, 164, 168, 170, 176, 184, 186, 188, 191, 193, 194, 196, 200, 204, 208, 217, 223
Offset: 1

Views

Author

Antti Karttunen, Jun 30 2020

Keywords

Comments

Numbers n such that when we start from k = n, and apply in some combination the nondeterministic maps k -> k - k/p and k -> k + k/p, (where p can be any of the odd prime factors of k), then for some combination we can reach a power of 2 in exactly two steps (but with no combination allowing 0 or 1 steps).

Examples

			For n = 70 = 2*5*7, if we first take p = 7 and apply the map n -> n + (n/p), we obtain 80 = 2^4 * 5. We then take p = 5, and apply the map n -> n - (n/p), to obtain 80-16 = 64 = 2^16. Thus we reached a power of 2 in two steps (and there are no shorter paths), therefore 70 is present in this sequence.
For n = 769, which is a prime, 769 - (769/769) yields 768 = 3 * 256. For 768 we can then apply either map to obtain a power of 2, as 768 - (768/3) = 512 = 2^9 and 768 + (768/3) = 1024 = 2^10. On the other hand, 769 + (769/769) = 770 and A335885(770) = 4, so that route would not lead to any shorter paths, therefore 769 is a term of this sequence.
		

Crossrefs

Row 2 of A335910.
Subsequences of semiprimes (union gives all odd semiprimes present): A144482, A333788, A336115.

Programs

A335911 Numbers of the form q*(2^k), where k >= 0 and q is either a Fermat prime or a Mersenne prime; Numbers k for which A335885(k) = 1.

Original entry on oeis.org

3, 5, 6, 7, 10, 12, 14, 17, 20, 24, 28, 31, 34, 40, 48, 56, 62, 68, 80, 96, 112, 124, 127, 136, 160, 192, 224, 248, 254, 257, 272, 320, 384, 448, 496, 508, 514, 544, 640, 768, 896, 992, 1016, 1028, 1088, 1280, 1536, 1792, 1984, 2032, 2056, 2176, 2560, 3072, 3584, 3968, 4064, 4112, 4352, 5120, 6144, 7168, 7936, 8128, 8191
Offset: 1

Views

Author

Antti Karttunen, Jun 30 2020

Keywords

Comments

Numbers k such that A000265(k) is either in A000668 or in A019434.
Product of any two terms (whether distinct or not) can be found in A335912.

Crossrefs

Row 1 of A335910.
Union of A334101 and A335431. Subsequence of A038550.
Cf. A141453 (after its initial 2, gives the primes present in this sequence).

Programs

Showing 1-4 of 4 results.