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 480 results. Next

A246277 Column index of n in A246278: a(1) = 0, a(2n) = n, a(2n+1) = a(A064989(2n+1)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 21 2014

Keywords

Comments

If n >= 2, n occurs in column a(n) of A246278.
By convention, a(1) = 0 because 1 does not occur in A246278.

Crossrefs

Terms of A348717 halved. A305897 is the restricted growth sequence transform.
Positions of terms 1 .. 8 in this sequence are given by the following sequences: A000040, A001248, A006094, A030078, A090076, A251720, A090090, A030514.
Cf. A078898 (has the same role with array A083221 as this sequence has with A246278).
This sequence is also used in the definition of the following permutations: A246274, A246276, A246675, A246677, A246683, A249815, A249817 (A249818), A249823, A249825, A250244, A250245, A250247, A250249.
Also in the definition of arrays A249821, A251721, A251722.
Sum of prime indices of a(n) is A359358(n) + A001222(n) - 1, cf. A326844.
A112798 lists prime indices, length A001222, sum A056239.

Programs

  • Mathematica
    a246277[n_Integer] := Module[{f, p, a064989, a},
      f[x_] := Transpose@FactorInteger[x];
      p[x_] := Which[
        x == 1, 1,
        x == 2, 1,
        True, NextPrime[x, -1]];
      a064989[x_] := Times @@ Power[p /@ First[f[x]], Last[f[x]]];
      a[1] = 0;
      a[x_] := If[EvenQ[x], x/2, NestWhile[a064989, x, OddQ]/2];
    a/@Range[n]]; a246277[84] (* Michael De Vlieger, Dec 19 2014 *)
  • 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)};
    A246277(n) = { if(1==n, 0, while((n%2), n = A064989(n)); (n/2)); };
    
  • PARI
    A246277(n) = if(1==n, 0, my(f = factor(n), k = primepi(f[1,1])-1); for (i=1, #f~, f[i,1] = prime(primepi(f[i,1])-k)); factorback(f)/2); \\ Antti Karttunen, Apr 30 2022
    
  • Python
    from sympy import factorint, prevprime
    from operator import mul
    from functools import reduce
    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 0 if n==1 else n//2 if n%2==0 else a(a064989(n))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 15 2017
  • Scheme
    ;; two different variants, the second one employing memoizing definec-macro)
    (define (A246277 n) (if (= 1 n) 0 (let loop ((n n)) (if (even? n) (/ n 2) (loop (A064989 n))))))
    (definec (A246277 n) (cond ((= 1 n) 0) ((even? n) (/ n 2)) (else (A246277 (A064989 n)))))
    

Formula

a(1) = 0, a(2n) = n, a(2n+1) = a(A064989(2n+1)) = a(A064216(n+1)). [Cf. the formula for A252463.]
Instead of the equation for a(2n+1) above, we may write a(A003961(n)) = a(n). - Peter Munn, May 21 2022
Other identities. For all n >= 1, the following holds:
For all w >= 0, a(p_{i} * p_{j} * ... * p_{k}) = a(p_{i+w} * p_{j+w} * ... * p_{k+w}).
For all n >= 2, A001222(a(n)) = A001222(n)-1. [a(n) has one less prime factor than n. Thus each semiprime (A001358) is mapped to some prime (A000040), etc.]
For all n >= 2, a(n) = A078898(A249817(n)).
For semiprimes n = p_i * p_j, j >= i, a(n) = A000040(1+A243055(n)) = p_{1+j-i}.
a(n) = floor(A348717(n)/2). - Antti Karttunen, Apr 30 2022
If n has prime factorization Product_{i=1..k} prime(x_i), then a(n) = Product_{i=2..k} prime(x_i-x_1+1). The opposite version is A358195, prime indices A358172, even bisection A241916. - Gus Wiseman, Dec 29 2022

A252463 Hybrid shift: a(1) = 1, a(2n) = n, a(2n+1) = A064989(2n+1); shift the even numbers one bit right, shift the prime factorization of odd numbers one step towards smaller primes.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 20 2014

Keywords

Comments

For any node n >= 2 in binary trees A005940 and A163511, a(n) gives the parent node of n. (Here we assume that their initial root 1 is its own parent).

Crossrefs

A252464 gives the number of iterations needed to reach 1 from n.
Bisections: A000027 and A064216.

Programs

  • Mathematica
    Table[Which[n == 1, 1, EvenQ@ n, n/2, True, Times @@ Power[
    Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ n], {n, 81}] (* Michael De Vlieger, Sep 16 2017 *)
  • PARI
    a064989(n) = factorback(Mat(apply(t->[max(precprime(t[1]-1), 1), t[2]], Vec(factor(n)~))~)); \\ A064989
    a(n) = if (n==1, 1, if (n%2, a064989(n), n/2)); \\ Michel Marcus, Oct 13 2021
  • Python
    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 1 if n==1 else n//2 if n%2==0 else a064989(n)
    print([a(n) for n in range(1, 51)]) # Indranil Ghosh, Sep 15 2017
    
  • Scheme
    (define (A252463 n) (cond ((<= n 1) n) ((even? n) (/ n 2)) (else (A064989 n))))
    

Formula

a(1) = 1, a(2n) = n, a(2n+1) = A064989(2n+1).
Other identities. For all n >= 1:
a(2n-1) = A064216(n).
A001222(a(n)) = A001222(n) - (1 - A000035(n)).
Above means: if n is odd, A001222(a(n)) = A001222(n) and if n is even, A001222(a(n)) = A001222(n) - 1.
Sum_{k=1..n} a(k) ~ c * n^2, where c = 1/8 + (1/2) * Product_{p prime > 2} ((p^2-p)/(p^2-q(p))) = 0.2905279467..., where q(p) = prevprime(p) (A151799). - Amiram Eldar, Jan 21 2023

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)

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

A326042 a(n) = A064989(sigma(A003961(n))), where A003961 shifts the prime factorization of n one step towards larger primes, and A064989 shifts it back towards smaller primes.

Original entry on oeis.org

1, 1, 2, 11, 1, 2, 2, 3, 29, 1, 5, 22, 4, 2, 2, 49, 3, 29, 2, 11, 4, 5, 6, 6, 34, 4, 22, 22, 1, 2, 17, 55, 10, 3, 2, 319, 10, 2, 8, 3, 7, 4, 2, 55, 29, 6, 8, 98, 85, 34, 6, 44, 6, 22, 5, 6, 4, 1, 29, 22, 13, 17, 58, 1091, 4, 10, 4, 33, 12, 2, 31, 87, 3, 10, 68, 22, 10, 8, 10, 49, 469, 7, 12, 44, 3, 2, 2, 15, 25, 29, 8, 66, 34, 8
Offset: 1

Views

Author

Antti Karttunen, Jun 16 2019

Keywords

Comments

For any other number n than those in A326182 we have a(n) < A003961(n).
Fixed points k (for which a(k) = k) satisfy A003973(k) = 2^e * A003961(k) for some exponent e >= 0. Applying A003961 to such numbers gives the odd terms in A336702, of which there are likely to be just a single instance, its initial 1. (Clarified Nov 07 2021).
Conjecture: There are no other fixed points than a(1) = 1. If true, then there are no odd perfect numbers. This condition is equivalent to the condition that if A161942 has no fixed points larger than one, then there are no odd perfect numbers. This follows as whenever k is a fixed point, that is, a(k) = k, then we should also have A003961(a(k)) = A003961(A064989(sigma(A003961(k)))) = A161942(A003961(k)) = A003961(k). Note that A003961 is an injective and surjective mapping from natural numbers to odd numbers, A064989 is its (left) inverse, and composition A003961(A064989(n)) is equivalent to A000265(n).
From Antti Karttunen, Aug 05 2020: (Start)
For any hypothetical odd perfect number x, we would have A003973(k) = 2 * A003961(k), with k = A064989(x) and x = A003961(k). Thus we would have a(k) = A064989(sigma(A003961(k))) = A064989(sigma(x)) = A064989(2*x) = A064989(x) = k. On the other hand, A003973(k) = sigma(A003961(k)) < A003961(A003961(k)) [see A286385 for the reason why], so a necessary condition for this is that x should be one of the terms of A246282. (Clarified Dec 01 2020).
(End)

Crossrefs

Cf. A000037, A000203, A000265, A000593, A003961, A003973, A064989, A161942, A162284, A246282, A286385, A326041, A326182, A336702 (numbers whose abundancy index is a power of 2).
Cf. A348736 [n - a(n)], A348738 [a(n) < n], A348739 [a(n) > n], A348750 [= A064989(a(A003961(n)))], A348940 [gcd(n,a(n))], A348941, A348942, A351456, A353767, A353790, A353794.
Cf. also A332223 for another conjugation of sigma.

Programs

  • Mathematica
    f1[p_, e_] := NextPrime[p]^e; a1[1] = 1; a1[n_] := Times @@ f1 @@@ FactorInteger[n]; f2[2, e_] := 1; f2[p_, e_] := NextPrime[p, -1]^e; a2[1] = 1; a2[n_] := Times @@ f2 @@@ FactorInteger[n]; a[n_] := a2[DivisorSigma[1, a1[n]]]; Array[a, 100] (* Amiram Eldar, Nov 07 2021 *)
  • PARI
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
    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)};
    A326042(n) = A064989(sigma(A003961(n)));

Formula

a(n) = A064989(A003973(n)) = A064989(sigma(A003961(n))).
For k in A000037, a(k) = A064989(A003973(k)/2) = A064989((1/2)*sigma(A003961(k))).
Multiplicative with a(p^e) = A064989((q^(e+1)-1)/(q-1)), where q = nextPrime(p). - Antti Karttunen, Nov 05 2021
a(n) = A353790(n) / A353767(n) = A353794(n) / A351456(n). - Antti Karttunen, May 13 2022

Extensions

Keyword:mult added by Antti Karttunen, Nov 05 2021

A250470 a(n) = A249817(A064989(A249818(n))).

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 5, 1, 4, 3, 7, 2, 11, 5, 6, 1, 13, 4, 17, 3, 8, 7, 19, 2, 9, 11, 10, 5, 23, 6, 29, 1, 12, 13, 15, 4, 31, 17, 14, 3, 37, 10, 41, 7, 16, 19, 43, 2, 25, 9, 18, 11, 47, 8, 21, 5, 20, 23, 53, 6, 59, 29, 22, 1, 27, 14, 61, 13, 24, 15, 67, 4, 71, 31, 26, 17, 35, 22, 73, 3, 28, 37, 79, 10, 33, 41, 30, 7, 83, 12, 55, 19, 32, 43, 39, 2, 89, 25, 34, 9, 97, 26, 101
Offset: 1

Views

Author

Antti Karttunen, Dec 06 2014

Keywords

Comments

Odd bisection, A250472, is a permutation of natural numbers. A250479 gives the even bisection.
For odd numbers n >= 3, a(n) = A078898(n)-th number k for which A055396(k) = A055396(n)-1. In other words, a(n) tells which number is located immediately above n in the sieve of Eratosthenes (see A083140, A083221) in the same column of the sieve that contains n.

Crossrefs

Odd bisection: A250472.
Even bisection: A250479.
Differs from A064989 for the first time at n=21, where a(21) = 8, while
A064989(21) = 10.

Programs

Formula

a(n) = A249817(A064989(A249818(n))).
Other identities. For all n >= 1:
a(A250469(n)) = n. [This is an inverse function for injection A250469.]
For all odd numbers n >= 3: A055396(a(n)) = A055396(n)-1.

A249745 Permutation of natural numbers: a(n) = (1 + A064989(A007310(n))) / 2.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 9, 10, 5, 12, 15, 8, 16, 19, 21, 22, 13, 24, 11, 27, 30, 17, 31, 34, 36, 18, 37, 40, 20, 42, 28, 26, 45, 49, 51, 52, 54, 55, 29, 33, 25, 14, 57, 64, 43, 66, 69, 39, 35, 70, 75, 44, 76, 48, 79, 82, 61, 84, 23, 87, 90, 47, 46, 91, 96, 97, 99, 58, 56, 60, 100, 62, 73, 72, 106, 112, 114, 115, 65, 117, 120, 38, 94, 121
Offset: 1

Views

Author

Antti Karttunen, Nov 23 2014

Keywords

Crossrefs

Inverse: A249746.
Row 2 of A251721.

Programs

  • Mathematica
    a249745[n_Integer] := Module[{f, p, a064989, a007310, a},
      f[x_] := Transpose@FactorInteger[x];
      p[x_] := Which[
        x == 1, 1,
        x == 2, 1,
        True, NextPrime[x, -1]];
      a064989[x_] := Times @@ Power[p /@ First[f[x]], Last[f[x]]];
      a007310[x_] := Select[Range[x], MemberQ[{1, 5}, Mod[#, 6]] &];
      a[x_] := (1 + a064989 /@ a007310[x])/2;
    a[n]]; a249745[252] (* Michael De Vlieger, Dec 18 2014, after Harvey P. Dale at A007310 *)
  • PARI
    A249745(n)=A064989(A007310(n))\2+1 \\ M. F. Hasler, Jan 19 2016
  • Scheme
    (define (A249745 n) (/ (+ 1 (A064989 (A007310 n))) 2))
    

Formula

a(n) = (A064989(A007310(n)) + 1) / 2.
a(n) = A048673(A249823(n)), as a composition of related permutations.
A007310(n) = A249735(a(n)) for all n >= 1. (This is the permutation which sorts the terms of A249735 into an ascending order, as they occur in A007310.)

A242424 Bulgarian solitaire operation on partition list A112798: a(1) = 1, a(n) = A000040(A001222(n)) * A064989(n).

Original entry on oeis.org

1, 2, 4, 3, 6, 6, 10, 5, 12, 9, 14, 10, 22, 15, 18, 7, 26, 20, 34, 15, 30, 21, 38, 14, 27, 33, 40, 25, 46, 30, 58, 11, 42, 39, 45, 28, 62, 51, 66, 21, 74, 50, 82, 35, 60, 57, 86, 22, 75, 45, 78, 55, 94, 56, 63, 35, 102, 69, 106, 42, 118, 87, 100, 13, 99, 70, 122, 65
Offset: 1

Views

Author

Antti Karttunen, May 13 2014

Keywords

Comments

In "Bulgarian solitaire" a deck of cards or another finite set of objects is divided into one or more piles, and the "Bulgarian operation" is performed by taking one card from each pile, and making a new pile of them, which is added to the remaining set of piles. Essentially, this operation is a function whose domain and range are unordered integer partitions (cf. A000041) and which preserves the total size of a partition (the sum of its parts). This sequence is induced when the operation is implemented on the partitions as ordered by the list A112798.
Please compare to the definition of A122111, which conjugates the partitions encoded with the same system.
a(n) is even if and only if n is either a prime or a multiple of three.
Conversely, a(n) is odd if and only if n is a nonprime not divisible by three.

References

  • Martin Gardner, Colossal Book of Mathematics, Chapter 34, Bulgarian Solitaire and Other Seemingly Endless Tasks, pp. 455-467, W. W. Norton & Company, 2001.

Crossrefs

Row 1 of A243070 (table which gives successive "recursive iterates" of this sequence and converges towards A122111).
Fixed points: A002110 (primorial numbers).

Programs

Formula

a(1) = 1, a(n) = A000040(A001222(n)) * A064989(n) = A105560(n) * A064989(n).
a(n) = A241909(A243051(A241909(n))).
a(n) = A243353(A226062(A243354(n))).
a(A000079(n)) = A000040(n) for all n.
A056239(a(n)) = A056239(n) for all n.

A245605 Permutation of natural numbers: a(1) = 1, a(2n) = 2 * a(A064989(2n-1)), a(2n-1) = 1 + (2 * a(A064989(2n-1)-1)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 10, 7, 8, 13, 18, 17, 26, 11, 12, 37, 34, 25, 74, 15, 16, 69, 50, 21, 14, 19, 20, 33, 138, 41, 66, 35, 52, 53, 22, 277, 82, 31, 32, 45, 554, 65, 90, 27, 36, 1109, 130, 101, 42, 43, 28, 73, 2218, 149, 30, 71, 104, 57, 146, 209, 114, 51, 148, 133, 70, 293, 418, 555, 164, 141, 586, 329, 282, 75, 68, 105, 106, 1173, 658, 23, 24
Offset: 1

Views

Author

Antti Karttunen, Jul 29 2014

Keywords

Comments

The even bisection halved gives A245607. The odd bisection incremented by one and halved gives A245707.

Crossrefs

Programs

  • PARI
    A064989(n) = my(f = factor(n)); for(i=1, #f~, if((2 == f[i,1]),f[i,1] = 1,f[i,1] = precprime(f[i,1]-1))); factorback(f);
    A245605(n) = if(1==n, 1, if(0==(n%2), 2*A245605(A064989(n-1)), 1+(2*A245605(A064989(n)-1))));
    for(n=1, 10001, write("b245605.txt", n, " ", A245605(n)));
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A245605 n) (cond ((= 1 n) 1) ((even? n) (* 2 (A245605 (A064989 (- n 1))))) (else (+ 1 (* 2 (A245605 (-1+ (A064989 n))))))))

Formula

a(1) = 1, a(2n) = 2 * a(A064989(2n-1)), a(2n-1) = 1 + (2 * a(A064989(2n-1)-1)).
a(1) = 1, a(2n) = 2 * a(A064216(n)), a(2n-1) = 1 + (2 * a(A064216(n)-1)).
As a composition of related permutations:
a(n) = A245607(A048673(n)).

A353749 a(n) = phi(n) * A064989(n), where phi is Euler totient function, and A064989 shifts the prime factorization one step towards lower primes.

Original entry on oeis.org

1, 1, 4, 2, 12, 4, 30, 4, 24, 12, 70, 8, 132, 30, 48, 8, 208, 24, 306, 24, 120, 70, 418, 16, 180, 132, 144, 60, 644, 48, 870, 16, 280, 208, 360, 48, 1116, 306, 528, 48, 1480, 120, 1722, 140, 288, 418, 1978, 32, 1050, 180, 832, 264, 2444, 144, 840, 120, 1224, 644, 3074, 96, 3540, 870, 720, 32, 1584, 280, 4026, 416
Offset: 1

Views

Author

Antti Karttunen, May 07 2022

Keywords

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := (p - 1)*p^(e - 1)*If[p == 2, 1, NextPrime[p, -1]^e]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 70] (* Amiram Eldar, May 07 2022 *)
  • PARI
    A064989(n) = { my(f=factor(n>>valuation(n,2))); for(i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f); };
    A353749(n) = (eulerphi(n)*A064989(n));

Formula

Multiplicative with a(p^e) = (p - 1) * p^(e-1) * q^e, where q is the largest prime less than p, and 1 if p = 2.
a(n) = A000010(n) * A064989(n).
For n >= 0, a(4n+2) = a(2n+1).
Sum_{k=1..n} a(k) ~ c * n^3, where c = (2/Pi^2) * Product_{p prime} ((p^3-q)/((p+1)*(p^2-q))) = 0.1118576617..., where q(p) = nextprime(p) = A151800(p). - Amiram Eldar, Dec 31 2022
Showing 1-10 of 480 results. Next