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

A246349 Positions of records in A246272.

Original entry on oeis.org

1, 2, 6, 10, 30, 42, 210, 330, 462, 2310, 6090, 30030, 66990, 94710, 434910, 651630, 1292646, 1610070, 2478630, 2497110, 2916690, 13220130, 20930910, 52582530, 60690630
Offset: 1

Views

Author

Antti Karttunen, Aug 23 2014

Keywords

Comments

All terms are squarefree. (See the comments in A246272).
From 2 onward they factorize as: 2, 2*3, 2*5, 2*3*5, 2*3*7, 2*3*5*7, 2*3*5*11, 2*3*7*11, 2*3*5*7*11, 2*3*5*7*29, 2*3*5*7*11*13, 2*3*5*7*11*29, 2*3*5*7*11*41, 2*3*5*7*19*109, 2*3*5*7*29*107, 2*3*17*19*23*29, 2*3*5*7*11*17*41, 2*3*5*7*11*29*37, 2*3*5*7*11*23*47, 2*3*5*7*17*19*43, 2*3*5*7*11*59*97, 2*3*5*7*11*13*17*41, 2*3*5*7*11*13*17*103, 2*3*5*7*11*13*43*47, ...

Crossrefs

A246350 gives the corresponding record values.
Cf. A246272.

Programs

  • PARI
    default(primelimit, 2^22)
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Using code of Michel Marcus
    A065338(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = (f[i, 1]%4)); factorback(f);
    A246272(n) = {my(i); i=0; while((A065338(n)!=1), i++; n = A003961(n)); i};
    \\ Compute the b-files for both the positions of records (A246349) and their values (A246350) at the same time:
    prevmax = -1; i = 0; for(n=1, 60690630, if((k=A246272(n)) > prevmax, prevmax = k; i++; write("b246349.txt", i, " ", n); write("b246350.txt", i, " ", k)));
    (Scheme, with Antti Karttunen's IntSeq-library)
    (define A246349 (RECORD-POS 1 1 A246272))

A246350 Record values in A246272.

Original entry on oeis.org

0, 2, 5, 9, 23, 49, 76, 77, 135, 377, 378, 1394, 1395, 1397, 1398, 1467, 1475, 2683, 2861, 3383, 3384, 4297, 7573, 10850, 10851
Offset: 1

Views

Author

Antti Karttunen, Aug 23 2014

Keywords

Crossrefs

Programs

Formula

a(n) = A246272(A246349(n)).

A003961 Completely multiplicative with a(prime(k)) = prime(k+1).

Original entry on oeis.org

1, 3, 5, 9, 7, 15, 11, 27, 25, 21, 13, 45, 17, 33, 35, 81, 19, 75, 23, 63, 55, 39, 29, 135, 49, 51, 125, 99, 31, 105, 37, 243, 65, 57, 77, 225, 41, 69, 85, 189, 43, 165, 47, 117, 175, 87, 53, 405, 121, 147, 95, 153, 59, 375, 91, 297, 115, 93, 61, 315, 67, 111, 275, 729, 119
Offset: 1

Views

Author

Keywords

Comments

Meyers (see Guy reference) conjectures that for all r >= 1, the least odd number not in the set {a(i): i < prime(r)} is prime(r+1). - N. J. A. Sloane, Jan 08 2021
Meyers' conjecture would be refuted if and only if for some r there were such a large gap between prime(r) and prime(r+1) that there existed a composite c for which prime(r) < c < a(c) < prime(r+1), in which case (by Bertrand's postulate) c would necessarily be a term of A246281. - Antti Karttunen, Mar 29 2021
a(n) is odd for all n and for each odd m there exists a k with a(k) = m (see A064216). a(n) > n for n > 1: bijection between the odd and all numbers. - Reinhard Zumkeller, Sep 26 2001
a(n) and n have the same number of distinct primes with (A001222) and without multiplicity (A001221). - Michel Marcus, Jun 13 2014
From Antti Karttunen, Nov 01 2019: (Start)
More generally, a(n) has the same prime signature as n, A046523(a(n)) = A046523(n). Also A246277(a(n)) = A246277(n) and A287170(a(n)) = A287170(n).
Many permutations and other sequences that employ prime factorization of n to encode either polynomials, partitions (via Heinz numbers) or multisets in general can be easily defined by using this sequence as one of their constituent functions. See the last line in the Crossrefs section for examples.
(End)

Examples

			a(12) = a(2^2 * 3) = a(prime(1)^2 * prime(2)) = prime(2)^2 * prime(3) = 3^2 * 5 = 45.
a(A002110(n)) = A002110(n + 1) / 2.
		

References

  • Richard K. Guy, editor, Problems From Western Number Theory Conferences, Labor Day, 1983, Problem 367 (Proposed by Leroy F. Meyers, The Ohio State U.).

Crossrefs

See A045965 for another version.
Row 1 of table A242378 (which gives the "k-th powers" of this sequence), row 3 of A297845 and of A306697. See also arrays A066117, A246278, A255483, A308503, A329050.
Cf. A064989 (a left inverse), A064216, A000040, A002110, A000265, A027746, A046523, A048673 (= (a(n)+1)/2), A108228 (= (a(n)-1)/2), A191002 (= a(n)*n), A252748 (= a(n)-2n), A286385 (= a(n)-sigma(n)), A283980 (= a(n)*A006519(n)), A341529 (= a(n)*sigma(n)), A326042, A049084, A001221, A001222, A122111, A225546, A260443, A245606, A244319, A246269 (= A065338(a(n))), A322361 (= gcd(n, a(n))), A305293.
Cf. A249734, A249735 (bisections).
Cf. A246261 (a(n) is of the form 4k+1), A246263 (of the form 4k+3), A246271, A246272, A246259, A246281 (n such that a(n) < 2n), A246282 (n such that a(n) > 2n), A252742.
Cf. A275717 (a(n) > a(n-1)), A275718 (a(n) < a(n-1)).
Cf. A003972 (Möbius transform), A003973 (Inverse Möbius transform), A318321.
Cf. A300841, A305421, A322991, A250469, A269379 for analogous shift-operators in other factorization and quasi-factorization systems.
Cf. also following permutations and other sequences that can be defined with the help of this sequence: A005940, A163511, A122111, A260443, A206296, A265408, A265750, A275733, A275735, A297845, A091202 & A091203, A250245 & A250246, A302023 & A302024, A302025 & A302026.
A version for partition numbers is A003964, strict A357853.
A permutation of A005408.
Applying the same transformation again gives A357852.
Other multiplicative sequences: A064988, A357977, A357978, A357980, A357983.
A056239 adds up prime indices, row-sums of A112798.

Programs

  • Haskell
    a003961 1 = 1
    a003961 n = product $ map (a000040 . (+ 1) . a049084) $ a027746_row n
    -- Reinhard Zumkeller, Apr 09 2012, Oct 09 2011
    (MIT/GNU Scheme, with Aubrey Jaffer's SLIB Scheme library)
    (require 'factor)
    (define (A003961 n) (apply * (map A000040 (map 1+ (map A049084 (factor n))))))
    ;; Antti Karttunen, May 20 2014
    
  • Maple
    a:= n-> mul(nextprime(i[1])^i[2], i=ifactors(n)[2]):
    seq(a(n), n=1..80);  # Alois P. Heinz, Sep 13 2017
  • Mathematica
    a[p_?PrimeQ] := a[p] = Prime[ PrimePi[p] + 1]; a[1] = 1; a[n_] := a[n] = Times @@ (a[#1]^#2& @@@ FactorInteger[n]); Table[a[n], {n, 1, 65}] (* Jean-François Alcover, Dec 01 2011, updated Sep 20 2019 *)
    Table[Times @@ Map[#1^#2 & @@ # &, FactorInteger[n] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[n == 1], {n, 65}] (* Michael De Vlieger, Mar 24 2017 *)
  • PARI
    a(n)=local(f); if(n<1,0,f=factor(n); prod(k=1,matsize(f)[1],nextprime(1+f[k,1])^f[k,2]))
    
  • PARI
    a(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Michel Marcus, May 17 2014
    
  • Perl
    use ntheory ":all";  sub a003961 { vecprod(map { next_prime($) } factor(shift)); }  # _Dana Jacobsen, Mar 06 2016
    
  • Python
    from sympy import factorint, prime, primepi, prod
    def a(n):
        f=factorint(n)
        return 1 if n==1 else prod(prime(primepi(i) + 1)**f[i] for i in f)
    [a(n) for n in range(1, 11)] # Indranil Ghosh, May 13 2017

Formula

If n = Product p(k)^e(k) then a(n) = Product p(k+1)^e(k).
Multiplicative with a(p^e) = A000040(A000720(p)+1)^e. - David W. Wilson, Aug 01 2001
a(n) = Product_{k=1..A001221(n)} A000040(A049084(A027748(n,k))+1)^A124010(n,k). - Reinhard Zumkeller, Oct 09 2011 [Corrected by Peter Munn, Nov 11 2019]
A064989(a(n)) = n and a(A064989(n)) = A000265(n). - Antti Karttunen, May 20 2014 & Nov 01 2019
A001221(a(n)) = A001221(n) and A001222(a(n)) = A001222(n). - Michel Marcus, Jun 13 2014
From Peter Munn, Oct 31 2019: (Start)
a(n) = A225546((A225546(n))^2).
a(A225546(n)) = A225546(n^2).
(End)
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p prime} ((p^2-p)/(p^2-nextprime(p))) = 2.06399637... . - Amiram Eldar, Nov 18 2022

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

A246271 Starting from A003961(n), the number of additional iterations of A003961 required for the result to be of the form 4k+1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 21 2014

Keywords

Examples

			a(5) = 2, because exactly two additional iterations of A003961 are needed before A003961(5) = 7 is of the form 4k+1; as A003961(7) = 11 and A003961(11) = 13. (We have 7 = 3 mod 4, 11 = 3 mod 4 and 13 = 1 mod 4.)
		

Crossrefs

A246261 gives the positions of zeros, A246263 the positions of nonzeros.
A246280 the positions where n occurs for the first time, A246167 the positions of new distinct values.

Programs

  • PARI
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Using code of Michel Marcus
    A246271(n) = {my(i); i=0; n = A003961(n); while(((n%4)!=1), i++; n = A003961(n)); i};
    for(n=1, 10001, write("b246271.txt", n, " ", A246271(n)));
    (Scheme, two different variants, the second one employing memoizing definec-macro)
    (define (A246271 n) (let loop ((i 0) (n n)) (let ((next (A003961 n))) (if (= 1 (modulo next 4)) i (loop (+ i 1) next)))))
    (definec (A246271 n) (if (= 1 (A246260 n)) 0 (+ 1 (A246271 (A003961 n)))))

Formula

If A246260(n) = 1, a(n) = 0, otherwise 1 + a(A003961(n)).

A252459 a(n) = Number of iterations of A003961 starting from n which are needed before the result is one of the numbers in A251726. a(1) = 0 by convention.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 17 2014

Keywords

Examples

			a(9) = 0, because 9 is already in A251726.
For n = 10, as 10 is in A251727, but A003961(10) = A251727(prime(1) * prime(3)) = prime(2) * prime(4) = 3*7 = 21 is in A251726, thus a(10) = 1.
For n = 14, as 14 is in A251727, and A003961(14) = 33 (prime(1) * prime(4) -> prime(2) * prime(5)) is also in A251727, and only at the second iteration, A003961(33) = 65 (prime(2) * prime(5) -> prime(3) * prime(6)) the result is in A251726, thus a(14) = 2.
		

Crossrefs

Cf. A003961, A066048, A251726 (gives the positions of zeros after a(1)=0), A252372.
Cf. also A246271, A246272.

Formula

a(1) = 0 and for n > 1, if A252372(n) = 1 then a(n) = 0, otherwise 1 + a(A003961(n)).
Other identities. For all n >= 1:
a(n) = a(A066048(n)). [The result depends only on the smallest and the largest prime factor of n.]

A246269 a(1) = 1, a(p(k)) = p(k+1) mod 4 for k-th prime p(k) and a(u * v) = a(u) * a(v) for u, v > 0.

Original entry on oeis.org

1, 3, 1, 9, 3, 3, 3, 27, 1, 9, 1, 9, 1, 9, 3, 81, 3, 3, 3, 27, 3, 3, 1, 27, 9, 3, 1, 27, 3, 9, 1, 243, 1, 9, 9, 9, 1, 9, 1, 81, 3, 9, 3, 9, 3, 3, 1, 81, 9, 27, 3, 9, 3, 3, 3, 81, 3, 9, 1, 27, 3, 3, 3, 729, 3, 3, 3, 27, 1, 27, 1, 27, 3, 3, 9, 27, 3, 3, 3, 243, 1, 9, 1, 27, 9, 9, 3, 27
Offset: 1

Views

Author

Antti Karttunen, Aug 21 2014

Keywords

Comments

This is a fully multiplicative sequence. Only powers of 3 (A000244) occur as terms.

Examples

			For n = 10 = 2*5 = p_1 * p_3 we have a(n) = (p_{1+1} mod 4)*(p_{3+1} mod 4) = (p_2 mod 4) * (p_4 mod 4) = (3 mod 4)*(7 mod 4) = 3*3 = 9.
		

Crossrefs

Programs

  • PARI
    default(primelimit, 2^22)
    A246269(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = (nextprime(f[i, 1]+1)%4)); factorback(f);
    for(n=1, 10080, write("b246269.txt", n, " ", A246269(n)));
    
  • Scheme
    (define (A246269 n) (A065338 (A003961 n)))

Formula

a(n) = A065338(A003961(n)).
a(n) = A000244(A246270(n)).

A246270 Number of prime factors of the form 4k+3 (counted with multiplicity) in A003961(n): a(n) = A065339(A003961(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 21 2014

Keywords

Crossrefs

Programs

Formula

a(n) = A065339(A003961(n)).
a(n) = A001222(A246269(n)).
a(n) = A007949(A246269(n)).
Other identities.
If n = u*v, a(n) = a(u)+a(v).
For all n >= 0, a(2^n) = n.
Showing 1-8 of 8 results.