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-10 of 76 results. Next

A252464 a(1) = 0, a(2n) = 1 + a(n), a(2n+1) = 1 + a(A064989(2n+1)); also binary width of terms of A156552 and A243071.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 3, 3, 4, 5, 4, 6, 5, 4, 4, 7, 4, 8, 5, 5, 6, 9, 5, 4, 7, 4, 6, 10, 5, 11, 5, 6, 8, 5, 5, 12, 9, 7, 6, 13, 6, 14, 7, 5, 10, 15, 6, 5, 5, 8, 8, 16, 5, 6, 7, 9, 11, 17, 6, 18, 12, 6, 6, 7, 7, 19, 9, 10, 6, 20, 6, 21, 13, 5, 10, 6, 8, 22, 7, 5, 14, 23, 7, 8, 15, 11, 8, 24, 6, 7, 11, 12, 16, 9, 7, 25, 6, 7, 6, 26, 9, 27
Offset: 1

Views

Author

Antti Karttunen, Dec 20 2014

Keywords

Comments

a(n) tells how many iterations of A252463 are needed before 1 is reached, i.e., the distance of n from 1 in binary trees like A005940 and A163511.
Similarly for A253553 in trees A253563 and A253565. - Antti Karttunen, Apr 14 2019

Examples

			From _Gus Wiseman_, Apr 02 2019: (Start)
The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), so a(n) is the size of the inner lining of the integer partition with Heinz number n, which is also the size of the largest hook of the same partition. For example, the partition with Heinz number 715 is (6,5,3), with diagram
  o o o o o o
  o o o o o
  o o o
which has inner lining
          o o
      o o o
  o o o
and largest hook
  o o o o o o
  o
  o
both of which have size 8, so a(715) = 8.
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[If[n==1,1,PrimeOmega[n]+PrimePi[FactorInteger[n][[-1,1]]]]-1,{n,100}] (* Gus Wiseman, Apr 02 2019 *)
  • PARI
    A061395(n) = if(n>1, primepi(vecmax(factor(n)[, 1])), 0);
    A252464(n) = (bigomega(n) + A061395(n) - 1); \\ Antti Karttunen, Apr 14 2019
    
  • Python
    from sympy import primepi, primeomega, primefactors
    def A252464(n): return primeomega(n)+primepi(max(primefactors(n)))-1 if n>1 else 0 # Chai Wah Wu, Jul 17 2023

Formula

a(1) = 0; for n > 1: a(n) = 1 + a(A252463(n)).
a(n) = A029837(1+A243071(n)). [a(n) = binary width of terms of A243071.]
a(n) = A029837(A005941(n)) = A029837(1+A156552(n)). [Also binary width of terms of A156552.]
Other identities. For all n >= 1:
a(A000040(n)) = n.
a(A001248(n)) = n+1.
a(A030078(n)) = n+2.
And in general, a(prime(n)^k) = n+k-1.
a(A000079(n)) = n. [I.e., a(2^n) = n.]
For all n >= 2:
a(n) = A001222(n) + A061395(n) - 1 = A001222(n) + A252735(n) = A061395(n) + A252736(n) = 1 + A252735(n) + A252736(n).
a(n) = A325134(n) - 1. - Gus Wiseman, Apr 02 2019
From Antti Karttunen, Apr 14 2019: (Start)
a(1) = 0; for n > 1: a(n) = 1 + a(A253553(n)).
a(n) = A001221(n) + A297167(n) = A297113(n) + A297155(n).
(End).

A245611 Permutation of natural numbers: a(n) = A243071(A064216(n)).

Original entry on oeis.org

0, 1, 3, 7, 2, 15, 31, 6, 63, 127, 14, 255, 5, 4, 511, 1023, 30, 13, 2047, 62, 4095, 8191, 12, 16383, 11, 126, 32767, 29, 254, 65535, 131071, 28, 61, 262143, 510, 524287, 1048575, 10, 27, 2097151, 8, 4194303, 125, 1022, 8388607, 59, 2046, 253, 16777215, 60, 33554431, 67108863, 26
Offset: 1

Views

Author

Antti Karttunen, Jul 28 2014

Keywords

Comments

Note the indexing: the domain starts from 1, while the range includes also zero.
The odd bisection of A243071 decremented by one and halved. (For a(1) = 0, take ceiling of -1/2).

Crossrefs

Programs

Formula

a(1) = 0, and for n > 1, a(n) = (1/2) * (A243071((2*n)-1) - 1).
As a composition of related permutations:
a(n) = A243071(A064216(n)).
a(n) = A054429(A244153(n)).

A253566 Permutation of natural numbers: a(n) = A243071(A122111(n)).

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 8, 7, 5, 12, 16, 14, 32, 24, 10, 15, 64, 13, 128, 28, 20, 48, 256, 30, 9, 96, 11, 56, 512, 26, 1024, 31, 40, 192, 18, 29, 2048, 384, 80, 60, 4096, 52, 8192, 112, 22, 768, 16384, 62, 17, 25, 160, 224, 32768, 27, 36, 120, 320, 1536, 65536, 58, 131072, 3072, 44, 63, 72, 104, 262144, 448, 640, 50, 524288, 61, 1048576, 6144, 21
Offset: 1

Views

Author

Antti Karttunen, Jan 03 2015

Keywords

Comments

Note the indexing: domain starts from one, while the range includes also zero. See also comments in A253564.
The a(n)-th composition in standard order (graded reverse-lexicographic, A066099) is one plus the first differences of the weakly increasing sequence of prime indices of n with 1 prepended. See formula for a simplification. The triangular form is A358169. The inverse is A253565. Not prepending 1 gives A358171. For Heinz numbers instead of standard compositions we have A325351 (without prepending A325352). - Gus Wiseman, Dec 23 2022

Examples

			From _Gus Wiseman_, Dec 23 2022: (Start)
This represents the following bijection between partitions and compositions. The reversed prime indices of n together with the a(n)-th composition in standard order are:
   1:        () -> ()
   2:       (1) -> (1)
   3:       (2) -> (2)
   4:     (1,1) -> (1,1)
   5:       (3) -> (3)
   6:     (2,1) -> (1,2)
   7:       (4) -> (4)
   8:   (1,1,1) -> (1,1,1)
   9:     (2,2) -> (2,1)
  10:     (3,1) -> (1,3)
  11:       (5) -> (5)
  12:   (2,1,1) -> (1,1,2)
  13:       (6) -> (6)
  14:     (4,1) -> (1,4)
  15:     (3,2) -> (2,2)
  16: (1,1,1,1) -> (1,1,1,1)
(End)
		

Crossrefs

Inverse: A253565.
Applying A000120 gives A001222.
A reverse version is A156552, inverse essentially A005940.
The inverse is A253565, triangular form A242628.
The triangular form is A358169.
A048793 gives partial sums of reversed standard comps, Heinz number A019565.
A066099 lists standard compositions, lengths A000120, sums A070939.
A112798 list prime indices, sum A056239.
A358134 gives partial sums of standard compositions, Heinz number A358170.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
    stcinv/@Table[Differences[Prepend[primeMS[n],1]]+1,{n,100}] (* Gus Wiseman, Dec 23 2022 *)
  • Scheme
    (define (A253566 n) (A243071 (A122111 n)))

Formula

a(n) = A243071(A122111(n)).
As a composition of other permutations:
a(n) = A054429(A253564(n)).
a(n) = A336120(n) + A336125(n). - Antti Karttunen, Jul 18 2020
If 2n = Product_{i=1..k} prime(x_i) then a(n) = Sum_{i=1..k-1} 2^(x_k-x_{k-i}+i-1). - Gus Wiseman, Dec 23 2022

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

A292943 a(n) = A292944(A243071(n)); Base-2 expansion of a(n) encodes the steps where numbers of the form 6k+3 are encountered when map x -> A252463(x) is iterated down to 1, starting from x=n.

Original entry on oeis.org

0, 0, 1, 0, 2, 2, 4, 0, 1, 4, 8, 4, 16, 8, 5, 0, 32, 2, 64, 8, 9, 16, 128, 8, 2, 32, 1, 16, 256, 10, 512, 0, 17, 64, 10, 4, 1024, 128, 33, 16, 2048, 18, 4096, 32, 9, 256, 8192, 16, 4, 4, 65, 64, 16384, 2, 18, 32, 129, 512, 32768, 20, 65536, 1024, 17, 0, 34, 34, 131072, 128, 257, 20, 262144, 8, 524288, 2048, 5, 256, 20, 66, 1048576, 32, 1, 4096
Offset: 1

Views

Author

Antti Karttunen, Sep 28 2017

Keywords

Crossrefs

Programs

Formula

a(n) = A292944(A243071(n)).
a(1) = 0, and for n > 1, a(n) = 2*a(A252463(n)) + [n == 3 (mod 6)], where the last part of the formula is Iverson bracket, giving 1 only if n is of the form 6k+3, and 0 otherwise.
For n >= 0, a(A163511(n)) = A292944(n).
For n >= 1, A292941(n) + a(n) + A292945(n) = a(n) + A292253(n) + A292255(n) = A243071(n).

A364288 a(n) = n - A243071(n).

Original entry on oeis.org

1, 1, 0, 2, -2, 0, -8, 4, 4, -4, -20, 0, -50, -16, 2, 8, -110, 8, -236, -8, -8, -40, -488, 0, 14, -100, 18, -32, -994, 4, -2016, 16, -28, -220, 8, 16, -4058, -472, -86, -16, -8150, -16, -16340, -80, 20, -976, -32720, 0, 26, 28, -202, -200, -65482, 36, -4, -64, -452, -1988, -131012, 8, -262082, -4032, 6, 32, -58, -56
Offset: 1

Views

Author

Antti Karttunen, Jul 25 2023

Keywords

Crossrefs

Cf. A243071, A364256 [= gcd(n,a(n))], A364258.
Cf. A007283 (positions of 0's, conjectured), A364289 (positions of terms <= 0), A364290 (of terms > 0), A364291 (of terms >= 0).
Cf. also A364253.

Programs

  • Mathematica
    nn = 60; f[x_] := Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First[#], Last[#] ] &@ Transpose@ FactorInteger@ x; Do[a[n] = Which[n <= 2, n - 1, OddQ[n], 1 + 2 a[f[n]], True, 2 a[n/2] ], {n, nn}]; Array[# - a[#] &, nn] (* Michael De Vlieger, Jul 25 2023 *)
  • PARI
    A064989(n) = { my(f=factor(n>>valuation(n,2))); 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)))));
    A364288(n) = (n-A243071(n));

Formula

a(n) = A364258(A243071(n)).
For n >= 1, a(2*n) = 2*a(n).
For n >= 0, a(A007283(n)) = 0.

A292263 a(n) = A292264(A243071(n)).

Original entry on oeis.org

0, 1, 2, 2, 5, 4, 11, 4, 4, 10, 23, 8, 47, 22, 8, 8, 95, 8, 191, 20, 20, 46, 383, 16, 9, 94, 8, 44, 767, 16, 1535, 16, 44, 190, 17, 16, 3071, 382, 92, 40, 6143, 40, 12287, 92, 16, 766, 24575, 32, 19, 18, 188, 188, 49151, 16, 41, 88, 380, 1534, 98303, 32, 196607, 3070, 40, 32, 89, 88, 393215, 380, 764, 34, 786431, 32, 1572863, 6142, 16, 764
Offset: 1

Views

Author

Antti Karttunen, Sep 30 2017

Keywords

Comments

Base-2 expansion of a(n) encodes the steps where numbers that are neither multiples of 2 nor 3 are encountered when map x -> A252463(x) is iterated down to 1, starting from x=n. An exception is the most significant bit of a(n) which corresponds with the final 1, but is shifted one bit-position towards right.

Crossrefs

Formula

a(n) = A292264(A243071(n)).
a(1) = 0, a(2) = 1, and for n > 2, a(n) = 2*a(A252463(n)) + [n = -1 or +1 (mod 6)].
Also, for n > 2, a(n) = 2*a(A252463(n)) + [n == 1 (mod 2)]*[abs(J(3|n)) == 1], where J is the Jacobi-symbol, and [ ]'s are Iverson brackets, whose product gives 1 only if n is an odd number for which J(3|n) = +1 or -1, and 0 otherwise.
a(n) = A292941(n) + A292945(n).
a(n) = A292253(n) + A292255(n).

A297171 Möbius transform of A243071.

Original entry on oeis.org

0, 1, 3, 1, 7, 2, 15, 2, 2, 6, 31, 5, 63, 14, 3, 4, 127, 2, 255, 13, 11, 30, 511, 10, 4, 62, 4, 29, 1023, 4, 2047, 8, 27, 126, 5, 4, 4095, 254, 59, 26, 8191, 12, 16383, 61, 10, 510, 32767, 20, 8, 4, 123, 125, 65535, 4, 21, 58, 251, 1022, 131071, 7, 262143, 2046, 26, 16, 53, 28, 524287, 253, 507, 6, 1048575, 8
Offset: 1

Views

Author

Antti Karttunen, Dec 26 2017

Keywords

Crossrefs

Cf. A008683, A064989, A243071, A297161 (rgs-transform of this sequence).
Cf. also A297112, A297156, A297172.

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)))));
    A297171(n) = sumdiv(n,d,moebius(n/d)*A243071(d));

Formula

a(n) = Sum_{d|n} A008683(n/d)*A243071(d).

A364497 Numbers k such that k divides A243071(k).

Original entry on oeis.org

1, 3, 6, 12, 24, 43, 48, 86, 96, 172, 192, 344, 384, 688, 768, 1177, 1376, 1536, 2354, 2752, 3072, 3503, 4708, 5504, 6144, 7006, 9416, 11008, 12288, 14012, 18832, 22016, 24576, 28024, 37664, 44032, 49152, 49477, 56048, 75328, 88064, 98304, 98954, 112096, 150656, 169413, 176128, 196608, 197908, 224192, 301312, 338826
Offset: 1

Views

Author

Antti Karttunen, Jul 27 2023

Keywords

Comments

If n is present, then 2*n is also present, and vice versa.
A007283 is included as a subsequence, because it gives the known fixed points of map n -> A163511(n).
Sequence A163511(A364496(.)) sorted into ascending order.

Crossrefs

Cf. A007283 (subsequence), A364498 (odd terms).
Cf. also A364295, A364494, A364496.

Programs

  • PARI
    A054429(n) = ((3<<#binary(n\2))-n-1); \\ From A054429
    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 };
    A243071(n) = if(n<=2, n-1, A054429(A156552(n)));
    isA364497(n) = !(A243071(n)%n);

A364289 Numbers k such that A243071(k) >= k.

Original entry on oeis.org

3, 5, 6, 7, 10, 11, 12, 13, 14, 17, 19, 20, 21, 22, 23, 24, 26, 28, 29, 31, 33, 34, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 51, 52, 53, 55, 56, 57, 58, 59, 61, 62, 65, 66, 67, 68, 69, 71, 73, 74, 76, 78, 79, 80, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 99, 101, 102, 103, 104, 106, 107, 109
Offset: 1

Views

Author

Antti Karttunen, Jul 25 2023

Keywords

Comments

If k is present, then 2*k is also present, and vice versa.

Crossrefs

Positions of terms <= 0 in A364288.
Cf. A007283 (subsequence), A243071, A364290 (complement).
Cf. also A364287.

Programs

Showing 1-10 of 76 results. Next