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.

A364254 a(n) = gcd(n, A332215(n)).

Original entry on oeis.org

1, 1, 3, 2, 5, 6, 7, 4, 1, 10, 1, 12, 1, 14, 1, 8, 1, 2, 1, 20, 1, 2, 23, 24, 1, 2, 9, 28, 1, 2, 31, 16, 1, 2, 1, 4, 1, 2, 1, 40, 1, 2, 1, 4, 3, 46, 1, 48, 1, 2, 1, 4, 1, 18, 1, 56, 1, 2, 1, 4, 1, 62, 1, 32, 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 15, 4, 1, 2, 1, 80, 1, 2, 1, 4, 5, 2, 1, 8, 1, 6, 13, 92, 1, 2, 1, 96, 1, 2, 3, 4
Offset: 1

Views

Author

Antti Karttunen, Jul 16 2023

Keywords

Crossrefs

Cf. also A364255.

Formula

a(n) = gcd(n, A364253(n)) = gcd(A332215(n), A364253(n)).

A364253 a(n) = n - A332215(n).

Original entry on oeis.org

1, 1, 0, 2, -10, 0, 0, 4, 4, -20, -52, 0, -242, 0, -14, 8, -494, 8, -1004, -40, 8, -104, -2024, 0, 2, -484, 18, 0, -4066, -28, 0, 16, -92, -988, 8, 16, -16346, -2008, -470, -80, -32726, 16, -65492, -208, -12, -4048, -262096, 0, 38, 4, -970, -968, -1048522, 36, -64, 0, -1988, -8132, -2097092, -56, -4194242, 0, 38, 32
Offset: 1

Views

Author

Antti Karttunen, Jul 16 2023

Keywords

Crossrefs

Cf. A332215, A335431 (conjectured positions of 0's), A364254.

Programs

Formula

For n > 1, a(2*n) = 2*a(n).
For all n >= 1, a(A335431(n)) = 0.

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)).

A243071 Permutation of nonnegative integers: a(1) = 0, a(2) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A064989(2n+1)).

Original entry on oeis.org

0, 1, 3, 2, 7, 6, 15, 4, 5, 14, 31, 12, 63, 30, 13, 8, 127, 10, 255, 28, 29, 62, 511, 24, 11, 126, 9, 60, 1023, 26, 2047, 16, 61, 254, 27, 20, 4095, 510, 125, 56, 8191, 58, 16383, 124, 25, 1022, 32767, 48, 23, 22, 253, 252, 65535, 18, 59, 120, 509, 2046, 131071
Offset: 1

Views

Author

Antti Karttunen, Jun 20 2014

Keywords

Comments

Note the indexing: the domain starts from 1, while the range includes also zero.
See also the comments at A163511, which is the inverse permutation to this one.

Crossrefs

Inverse: A163511.
Cf. A000040, A000225, A007814, A054429, A064989, A064216, A122111, A209229, A245611 (= (a(2n-1)-1)/2, for n > 1), A245612, A292383, A292385, A297171 (Möbius transform).
Cf. A007283 (known positions where a(n)=n), A364256 [= gcd(n,a(n))], A364288 [= n-a(n)], A364289 [where a(n)>=n], A364290 [where a(n)A364291 [where a(n)<=n], A364497 [where n|a(n)].
Cf. A156552 (variant with inverted binary code), A253566, A332215, A332811, A334859 (other variants).

Programs

  • 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)};
    A243071(n) = if(n<=2, n-1, if(!(n%2), 2*A243071(n/2), 1+(2*A243071(A064989(n))))); \\ Antti Karttunen, Jul 18 2020
    
  • PARI
    A243071(n) = if(n<=2, n-1, 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]); ((3<<#binary(res\2))-res-1)); \\ (Combining programs given in A156552 and A054429) - Antti Karttunen, Jul 28 2023
    
  • Python
    from functools import reduce
    from sympy import factorint, prevprime
    from operator import mul
    def a064989(n):
        f = factorint(n)
        return 1 if n==1 else reduce(mul, (1 if i==2 else prevprime(i)**f[i] for i in f))
    def a(n): return n - 1 if n<3 else 2*a(n//2) if n%2==0 else 1 + 2*a(a064989(n))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 15 2017
  • Scheme
    ;; With memoizing definec-macro from Antti Karttunen's IntSeq-library.
    (definec (A243071 n) (cond ((<= n 2) (- n 1)) ((even? n) (* 2 (A243071 (/ n 2)))) (else (+ 1 (* 2 (A243071 (A064989 n)))))))
    

Formula

a(1) = 0, a(2) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A064989(2n+1)).
For n >= 1, a(A000040(n)) = A000225(n).
For n >= 1, a(2n+1) = 1 + 2*a(A064216(n+1)).
From Antti Karttunen, Jul 18 2020: (Start)
a(n) = A245611(A048673(n)).
a(n) = A253566(A122111(n)).
a(n) = A334859(A225546(n)).
For n >= 2, a(n) = A054429(A156552(n)).
a(n) = A292383(n) + A292385(n) = A292383(n) OR A292385(n).
For n > 1, A007814(a(n)) = A007814(n) - A209229(n). [This map preserves the 2-adic valuation of n, except when n is a power of two, in which cases it is decremented by one.]
(End)

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

A332214 Mersenne-prime fixing variant of permutation A163511: a(n) = A332212(A163511(n)).

Original entry on oeis.org

1, 2, 4, 3, 8, 9, 6, 7, 16, 27, 18, 49, 12, 21, 14, 5, 32, 81, 54, 343, 36, 147, 98, 25, 24, 63, 42, 35, 28, 15, 10, 31, 64, 243, 162, 2401, 108, 1029, 686, 125, 72, 441, 294, 175, 196, 75, 50, 961, 48, 189, 126, 245, 84, 105, 70, 155, 56, 45, 30, 217, 20, 93, 62, 11, 128, 729, 486, 16807, 324, 7203, 4802, 625, 216, 3087, 2058, 875
Offset: 0

Views

Author

Antti Karttunen, Feb 09 2020

Keywords

Comments

Any Mersenne prime (A000668) times any power of 2, i.e., sequence A335431, is fixed by this map (note the indexing), including also all even perfect numbers. It is not currently known whether there are any additional fixed points.
Because a(n) has the same prime signature as A163511(n), it implies that applying A046523 and A052409 to this sequence gives the same results as with A163511, namely, sequences A278531 and A365805. - Antti Karttunen, Oct 09 2023

Crossrefs

Cf. A163511, A332211, A332212, A332215 (inverse permutation).
Cf. A278531 [= A046523(a(n))], A290251 [= A001222(a(n))], A365805 [= A052409(a(n))], A366372 [= a(n)-n], A366373 [= gcd(n,a(n))], A366374 (numerator of n/a(n)), A366375 (denominator of n/a(n)), A366376.
Cf. A000043, A000668, A000396, A324200, A335431 (conjectured to give all the fixed points).

Programs

  • PARI
    A332214(n) = A332212(A163511(n));
    
  • PARI
    \\ Needs precomputed data for A332211:
    v332211 = readvec("b332211_to.txt"); \\ Prepared with gawk ' { print $2 } ' < b332211.txt > b332211_to.txt
    A332211(n) = v332211[n];
    A332214(n) = if(!n, 1, my(i=1, p=A332211(i), t=1); while(n>1, if(!(n%2), (t*=p), i++; p=A332211(i)); n >>= 1); (t*p)); \\ Antti Karttunen, Oct 09 2023

Formula

a(n) = A332212(A163511(n)).

A332210 Permutation of primes, inverse of A332211.

Original entry on oeis.org

2, 3, 7, 5, 13, 19, 23, 29, 31, 37, 11, 43, 47, 53, 61, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 131, 137, 139, 149, 17, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383
Offset: 1

Views

Author

Antti Karttunen, Feb 09 2020

Keywords

Comments

Sequence is well-defined also in case there are only a finite number of Mersenne primes.

Crossrefs

Used to construct permutations A332213, A332215.

Programs

  • PARI
    up_to = 127;
    A332210list(up_to) = { my(lista=List([]), xs=Map(), i=1, q, u); for(n=1,up_to, if(!isprime(q=((2^n)-1)), while(mapisdefined(xs,prime(i)), i++); q = prime(i)); mapput(xs,q,n)); for(i=1,oo,if(!mapisdefined(xs,prime(i),&u),return(Vec(lista)),listput(lista,prime(u)))); };
    \\ For computing a larger number of terms, use the precomputed values of A000043:
    v000043 = [2,3,5,7,13,17,19,31,61,89,107,127,521,607,1279, 2203,2281,3217,4253,4423,9689,9941,11213,19937, 21701,23209,44497,86243,110503,132049,216091, 756839,859433,1257787,1398269,2976221,3021377, 6972593,13466917,20996011,24036583,25964951, 30402457,32582657,37156667,42643801,43112609];
    A332210list(up_to) = { my(lista=List([]), xs=Map(), m000043 = Map(), i=1, q, u); for(k=1,#v000043,mapput(m000043,v000043[k],k)); for(n=1,min(up_to,v000043[#v000043]), if(mapisdefined(m000043,n), q = (2^n)-1, while(mapisdefined(xs,prime(i)), i++); q = prime(i)); mapput(xs,q,n)); for(i=1,oo,if(!mapisdefined(xs,prime(i),&u),return(Vec(lista)),listput(lista,prime(u)))); };
    v332210 = A332210list(up_to);
    A332210(n) = v332210[n];

Formula

For all applicable n >= 1, a(A059305(n)) = a(A000720(A000668(n))) = A000040(A000043(n)).

A332213 Fully multiplicative with a(p) = A332210(A000720(p)).

Original entry on oeis.org

1, 2, 3, 4, 7, 6, 5, 8, 9, 14, 13, 12, 19, 10, 21, 16, 23, 18, 29, 28, 15, 26, 31, 24, 49, 38, 27, 20, 37, 42, 11, 32, 39, 46, 35, 36, 43, 58, 57, 56, 47, 30, 53, 52, 63, 62, 61, 48, 25, 98, 69, 76, 71, 54, 91, 40, 87, 74, 73, 84, 79, 22, 45, 64, 133, 78, 83, 92, 93, 70, 89, 72, 97, 86, 147, 116, 65, 114, 101, 112, 81, 94, 103, 60, 161, 106, 111
Offset: 1

Views

Author

Antti Karttunen, Feb 09 2020

Keywords

Crossrefs

Cf. A000043, A000668, A000720, A332210, A332212 (inverse permutation), A332215.

Programs

  • PARI
    \\ Needs also code from A332210:
    A332213(n) = { my(f=factor(n)); f[,1] = apply(A332210,apply(primepi,f[,1])); factorback(f); };

Formula

a(1) = 1, a(p^e) = A332210(A000720(p))^e, a(m*n) = a(m)*a(n).

A332811 a(n) = A243071(A332808(n)).

Original entry on oeis.org

0, 1, 3, 2, 7, 6, 15, 4, 5, 14, 63, 12, 31, 30, 13, 8, 127, 10, 255, 28, 29, 126, 1023, 24, 11, 62, 9, 60, 511, 26, 4095, 16, 125, 254, 27, 20, 2047, 510, 61, 56, 8191, 58, 16383, 252, 25, 2046, 65535, 48, 23, 22, 253, 124, 32767, 18, 123, 120, 509, 1022, 262143, 52, 131071, 8190, 57, 32, 59, 250, 1048575, 508, 2045, 54, 4194303, 40, 524287, 4094, 21
Offset: 1

Views

Author

Antti Karttunen, Mar 05 2020

Keywords

Crossrefs

Cf. A332817 (inverse permutation).
Cf. also A332215.

Programs

  • PARI
    up_to = 26927;
    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)};
    A243071(n) = if(n<=2, n-1, if(!(n%2), 2*A243071(n/2), 1+(2*A243071(A064989(n)))));
    A332806list(up_to) = { my(v=vector(2), xs=Map(), lista=List([]), p,q,u); v[2] = 3; v[1] = 5; mapput(xs,1,1); mapput(xs,2,2); mapput(xs,3,3);  for(n=4,up_to, p = v[2-(n%2)]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[2-(n%2)] = q; mapput(xs,primepi(q),n)); for(i=1, oo, if(!mapisdefined(xs, i, &u), return(Vec(lista)), listput(lista, prime(u)))); };
    v332806 = A332806list(up_to);
    A332806(n) = v332806[n];
    A332808(n) = { my(f=factor(n)); f[,1] = apply(A332806,apply(primepi,f[,1])); factorback(f); };
    A332811(n) = A243071(A332808(n));

Formula

a(n) = A243071(A332808(n)).
For n > 1, a(n) = A054429(A332816(n)).
a(n) = A332895(n) + A332896(n).
a(n) = A332895(n) OR A332896(n) = A332895(n) XOR A332896(n).
A000120(a(n)) = A332899(n).
Showing 1-9 of 9 results.