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

A335879 a(n) = A332215(A335882(n)).

Original entry on oeis.org

15, 5, 30, 63, 255, 10, 60, 13, 126, 2047, 510, 20, 120, 26, 252, 4094, 262143, 11, 1020, 4194303, 40, 240, 52, 504, 8188, 61, 524286, 22, 2040, 8388606, 80, 480, 104, 1008, 16376, 122, 1048572, 140737488355327, 44, 4080, 59, 4503599627370495, 16777212, 160, 960, 208, 2016, 32752, 244, 2097144, 253, 281474976710654, 2417851639229258349412351
Offset: 1

Views

Author

Antti Karttunen, Jul 10 2020

Keywords

Comments

For all n, a(n) <> A335882(n). Proof: We need to consider only the odd terms, because for n > 1, A332215(2^k * n) = 2^k * A332215(n). The odd terms of A335882 are either primes or semiprimes whose both factors are Mersenne primes, terms of A144482.
(A) If A335882(n) is a prime, then a(n) = A332215(A335882(n)) is a term of A000225 (of the form 2^k - 1, a binary repunit), while primes in A335882 are certainly not of that form, as all Mersenne primes (A000668) are on a different row in array A335430 (on row 1, A335431).
(B) For any semiprime k in A335882, there is only one non-leading zero in the binary representation of A332215(k). On the other hand, a product of two Mersenne primes always contains more than one non-leading zero in its base-2 representation: for three times a Mersenne prime, there are two such zeros, as explained in A279389, and products of two Mersenne primes > 3 are always of the form 8k+1, with at least two zeros immediately left of the least significant 1-bit.

Crossrefs

Formula

a(n) = A332215(A335882(n)).
For all n >= 1, A007814(a(n)) = A007814(A335882(n)).

A331410 a(n) is the number of iterations needed to reach a power of 2 starting at n and using the map k -> k + k/p, where p is the largest prime factor of k.

Original entry on oeis.org

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

Views

Author

Ali Sada, Jan 16 2020

Keywords

Comments

Let f(n) = A000265(n) be the odd part of n. Let p be the largest prime factor of k, and say k = p * m. Suppose that k is not a power of 2, i.e., p > 2, then f(k) = p * f(m). The iteration is k -> k + k/p = p*m + m = (p+1) * m. So, p * f(m) -> f(p+1) * f(m). Since for p > 2, f(p+1) < p, the odd part in each iteration decreases, until it becomes 1, i.e., until we reach a power of 2. - Amiram Eldar, Feb 19 2020
Any odd prime factor of k can be used at any step of the iteration, and the result will be same. Thus, like A329697, this is also fully additive sequence. - Antti Karttunen, Apr 29 2020
If and only if a(n) is equal to A005087(n), then sigma(2n) - sigma(n) is a power of 2. (See A336923, A046528). - Antti Karttunen, Mar 16 2021

Examples

			The trajectory of 15 is [15,18,24,32], taking 3 iterations to reach 32. So, a(15) = 3.
		

Crossrefs

Cf. A000265, A005087, A006530 (greatest prime factor), A052126, A078701, A087436, A329662 (positions of records and the first occurrences of each n), A334097, A334098, A334108, A334861, A336467, A336921, A336922, A336923 (A046528).
Cf. array A335430, and its rows A335431, A335882, and also A335874.
Cf. also A329697 (analogous sequence when using the map k -> k - k/p), A335878.
Cf. also A330437, A335884, A335885, A336362, A336363 for other similar iterations.

Programs

  • Magma
    f:=func; g:=func; a:=[]; for n in [1..1000] do k:=n; s:=0; while not g(k) do  s:=s+1; k:=f(k); end while; Append(~a,s); end for; a; // Marius A. Burtea, Jan 19 2020
    
  • Mathematica
    a[n_] := -1 + Length @ NestWhileList[# + #/FactorInteger[#][[-1, 1]] &, n, # / 2^IntegerExponent[#, 2] != 1 &]; Array[a, 100] (* Amiram Eldar, Jan 16 2020 *)
  • PARI
    A331410(n) = if(!bitand(n,n-1),0,1+A331410(n+(n/vecmax(factor(n)[, 1])))); \\ Antti Karttunen, Apr 29 2020
    
  • PARI
    A331410(n) = { my(k=0); while(bitand(n,n-1), k++; my(f=factor(n)[, 1]); n += (n/f[2-(n%2)])); (k); }; \\ Antti Karttunen, Apr 29 2020
    
  • PARI
    A331410(n) = { my(f=factor(n)); sum(k=1,#f~,if(2==f[k,1],0,f[k,2]*(1+A331410(1+f[k,1])))); }; \\ Antti Karttunen, Apr 30 2020

Formula

From Antti Karttunen, Apr 29 2020: (Start)
This is a completely additive sequence: a(2) = 0, a(p) = 1+a(p+1) for odd primes p, a(m*n) = a(m)+a(n), if m,n > 1.
a(2n) = a(A000265(n)) = a(n).
If A209229(n) == 1, a(n) = 0, otherwise a(n) = 1 + a(n+A052126(n)), or equally, 1 + a(n+(n/A078701(n))).
a(n) = A334097(n) - A334098(n).
a(A122111(n)) = A334108(n).
(End)
a(n) = A334861(n) - A329697(n). - Antti Karttunen, May 14 2020
a(n) = a(A336467(n)) + A087436(n) = A336921(n) + A087436(n). - Antti Karttunen, Mar 16 2021

Extensions

Data section extended up to a(105) by Antti Karttunen, Apr 29 2020

A335431 Numbers of the form q*(2^k), where q is one of the Mersenne primes (A000668) and k >= 0.

Original entry on oeis.org

3, 6, 7, 12, 14, 24, 28, 31, 48, 56, 62, 96, 112, 124, 127, 192, 224, 248, 254, 384, 448, 496, 508, 768, 896, 992, 1016, 1536, 1792, 1984, 2032, 3072, 3584, 3968, 4064, 6144, 7168, 7936, 8128, 8191, 12288, 14336, 15872, 16256, 16382, 24576, 28672, 31744, 32512, 32764, 49152, 57344, 63488, 65024, 65528, 98304, 114688, 126976, 130048, 131056, 131071
Offset: 1

Views

Author

Antti Karttunen, Jun 28 2020

Keywords

Comments

Numbers of the form 2^k * ((2^p)-1), where p is one of the primes in A000043, and k >= 0.
Numbers k such that A000265(k) is in A000668.
Numbers k for which A331410(k) = 1.
Numbers k that themselves are not powers of two, but for which A335876(k) = k+A052126(k) is [a power of 2].
Conjecture: This sequence gives all fixed points of map n -> A332214(n) and its inverse n -> A332215(n). See also notes in A029747 and in A163511.

Crossrefs

Cf. A000043, A000396 (even terms form a subsequence), A000668 (primes present), A335882, A341622.
Row 1 of A335430.
Positions of 1's in A331410, in A364260, and in A364251 (characteristic function).
Subsequence of A054784.

Programs

  • Mathematica
    qs = 2^MersennePrimeExponent[Range[6]] - 1; max = qs[[-1]]; Reap[Do[n = 2^k*q; If[n <= max, Sow[n]], {k, 0, Log2[max]}, {q, qs}]][[2, 1]] // Union (* Amiram Eldar, Feb 18 2021 *)
  • PARI
    A000265(n) = (n>>valuation(n,2));
    isA000668(n) = (isprime(n)&&!bitand(n,1+n));
    isA335431(n) = isA000668(A000265(n));

Formula

A332214(a(n)) = A332215(a(n)) = a(n) for all n.
Sum_{n>=1} 1/a(n) = 2 * A173898 = 1.0329083578... - Amiram Eldar, Feb 18 2021

A332215 Mersenne-prime fixing variant of A243071: a(n) = A243071(A332213(n)).

Original entry on oeis.org

0, 1, 3, 2, 15, 6, 7, 4, 5, 30, 63, 12, 255, 14, 29, 8, 511, 10, 1023, 60, 13, 126, 2047, 24, 23, 510, 9, 28, 4095, 58, 31, 16, 125, 1022, 27, 20, 16383, 2046, 509, 120, 32767, 26, 65535, 252, 57, 4094, 262143, 48, 11, 46, 1021, 1020, 1048575, 18, 119, 56, 2045, 8190, 2097151, 116, 4194303, 62, 25, 32, 503, 250, 8388607, 2044, 4093, 54, 16777215, 40
Offset: 1

Views

Author

Antti Karttunen, Feb 09 2020

Keywords

Comments

Any Mersenne prime (A000668) times any power of 2 (i.e., 2^k, for k>=0) is fixed by this sequence, including also all even perfect numbers.
From Antti Karttunen, Jul 10 2020: (Start)
This is a "tuned variant" of A243071, and has many of the same properties.
For example, for n > 1, A007814(a(n)) = A007814(n) - A209229(n), that is, this map preserves the 2-adic valuation of n, except when n is a power of two, in which cases that value is decremented by one, and in particular, a(2^k * n) = 2^k * a(n) for all n > 1. Also, like A243071, this bijection maps primes to the terms of A000225 (binary repunits). However, the "tuning" (A332213) has a specific effect that each Mersenne prime (A000668) is mapped to itself. Therefore the terms of A335431 are fixed by this map. Furthermore, I conjecture that there are no other fixed points. For the starters, see the proof in A335879, which shows that at least none of the terms of A335882 are fixed.
(End)

Crossrefs

Cf. A243071, A332210, A332213, A332214 (inverse permutation), A335431 (conjectured to be all the fixed points), A335879.

Programs

Formula

a(n) = A243071(A332213(n)).
For all n >= 1, a(A335431(n)) = A335431(n), a(A335882(n)) = A335879(n). - Antti Karttunen, Jul 10 2020

A144482 Semiprimes that are a product of Mersenne primes.

Original entry on oeis.org

9, 21, 49, 93, 217, 381, 889, 961, 3937, 16129, 24573, 57337, 253921, 393213, 917497, 1040257, 1572861, 3670009, 4063201, 16252897, 16646017, 66584449, 67092481, 1073602561, 4294434817, 6442450941, 15032385529, 17179607041
Offset: 1

Views

Author

G. L. Honaker, Jr., Oct 12 2008

Keywords

Comments

As the product of any two primes is semiprime by definition, this is also the list of composite numbers n=x*y where both x and y are Mersenne primes. - Christian N. K. Anderson, Mar 25 2013

Crossrefs

Subsequence of A335882.

Programs

  • Mathematica
    Take[Times@@@Tuples[2^# -1&/@MersennePrimeExponent[Range[10]],2]//Union,30] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 30 2020 *)
  • PARI
    isA000668(n) = (isprime(n)&&!bitand(n,1+n));
    isA144482(n) = ((2==bigomega(n))&&isA000668(vecmin(factor(n)[,1]))&&isA000668(vecmax(factor(n)[,1]))); \\ Antti Karttunen, Jun 28 2020

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),", "));

A335874 Primes of the form q*2^h - 1, where q is a Mersenne prime (A000668).

Original entry on oeis.org

2, 5, 11, 13, 23, 47, 61, 191, 223, 383, 991, 3583, 3967, 6143, 16381, 63487, 253951, 262111, 786431, 917503, 1048447, 1048573, 4194271, 14680063, 16777183, 67108351, 260046847, 3758096383, 4261412863, 51539607551, 68718952447, 266287972351, 824633720831, 1065151889407, 1099503239167
Offset: 1

Views

Author

Antti Karttunen, Jun 28 2020

Keywords

Comments

Primes p such that A331410(1+p) = 1. After 2, primes p for which A331410(p) = 2.

Crossrefs

After 2, primes in A335882.
Cf. also A334092.

Programs

Extensions

a(28)-a(35) from David A. Corneth, Jun 28 2020

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

A336122 Numbers k for which A335884(k) = 2.

Original entry on oeis.org

5, 7, 9, 10, 14, 18, 20, 28, 36, 40, 56, 72, 80, 112, 144, 160, 224, 288, 320, 448, 576, 640, 896, 1152, 1280, 1792, 2304, 2560, 3584, 4608, 5120, 7168, 9216, 10240, 14336, 18432, 20480, 28672, 36864, 40960, 57344, 73728, 81920, 114688, 147456, 163840, 229376, 294912, 327680, 458752, 589824, 655360, 917504, 1179648, 1310720
Offset: 1

Views

Author

Antti Karttunen, Jul 09 2020

Keywords

Comments

Numbers n such that when we start from k = n, and apply in any 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), a power of 2 will appear no later than after two such steps, and on some of the combinations a power of 2 will appear after exactly two steps.

Crossrefs

Cf. A335884.
Cf. also A334102, A335882, A335912.

Programs

Showing 1-9 of 9 results.