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.

A250476 Permutation of natural numbers: a(n) = A249826(A249823(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 14, 9, 10, 21, 11, 12, 13, 15, 33, 16, 25, 17, 18, 32, 19, 20, 22, 39, 23, 24, 36, 26, 50, 43, 27, 28, 29, 30, 31, 34, 55, 56, 46, 92, 35, 37, 68, 38, 40, 59, 58, 41, 42, 70, 44, 86, 45, 47, 78, 48, 144, 49, 51, 77, 66, 52, 53, 54, 57, 91, 81, 80, 60, 88, 109, 87, 61, 62, 63, 64, 99, 65, 67, 226, 105, 69, 101, 71, 121, 72, 111, 73, 74
Offset: 1

Views

Author

Antti Karttunen, Dec 07 2014

Keywords

Crossrefs

Inverse: A250475.
Row 3 of A251722.

Programs

Formula

a(n) = A249826(A249823(n)).

A275715 Permutation of natural numbers: a(n) = A243071(A249823(n)).

Original entry on oeis.org

0, 1, 3, 7, 15, 31, 63, 127, 2, 255, 511, 6, 1023, 2047, 4095, 8191, 5, 16383, 14, 32767, 65535, 30, 131071, 262143, 524287, 13, 1048575, 2097151, 62, 4194303, 29, 126, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 254, 61, 11, 4, 536870911, 1073741823, 125, 2147483647, 4294967295, 27, 510, 8589934591
Offset: 1

Views

Author

Antti Karttunen, Aug 06 2016

Keywords

Comments

Note the indexing: the domain starts from 1, while the range includes also zero.

Crossrefs

Inverse: A275716.
Related or similar permutations: A243071, A249823, A245611.
Cf. also A273664, A273669.

Programs

Formula

a(n) = A243071(A249823(n)).

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

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

A249821 Square array of permutations: A(row,col) = A246277(A083221(row,col)), read by antidiagonals A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ... .

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 3, 2, 1, 5, 5, 3, 2, 1, 6, 4, 5, 3, 2, 1, 7, 7, 7, 5, 3, 2, 1, 8, 11, 11, 7, 5, 3, 2, 1, 9, 6, 13, 11, 7, 5, 3, 2, 1, 10, 13, 17, 13, 11, 7, 5, 3, 2, 1, 11, 17, 4, 17, 13, 11, 7, 5, 3, 2, 1, 12, 10, 19, 19, 17, 13, 11, 7, 5, 3, 2, 1, 13, 19, 23, 23, 19, 17, 13, 11, 7, 5, 3, 2, 1, 14, 9, 6, 29, 23, 19, 17, 13, 11, 7, 5, 3, 2, 1, 15, 8, 29, 31, 29, 23, 19, 17, 13, 11, 7, 5, 3, 2, 1
Offset: 1

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Comments

Permutation A249817 preserves the smallest prime factor of n, i.e., A055396(A249817(n)) = A055396(n), in other words, keeps all the terms that appear on any row of A246278 on the same row of A083221. Permutations in this table are induced by changes that A249817 does onto each row of the latter table, thus permutation on row r of this table can be used to sort row r of A246278 into ascending order. I.e., A246278(r, A(r,c)) = A083221(r,c) [the corresponding row in the Sieve of Eratosthenes, where each row appears in monotone order].
The multi-set of cycle-sizes of permutation A249817 is a disjoint union of cycle-sizes of all permutations in this array. For example, A249817 has a 7-cycle (33 39 63 57 99 81 45) which originates from the 7-cycle (6 7 11 10 17 14 8) of A064216, which occurs as the second row in this table.
On each row, 4 is the first composite number (and the first term less than previous, apart from row 1), and on row n it occurs in position A250474(n). This follows because A001222(A246277(n)) = A001222(n)-1 and because on each row of A083221 (see A083140) all terms between the square of prime (second term on each row) and the first cube (of the same prime, this cube mapping in this array to 4) are nonsquare semiprimes (A006881), this implies that the corresponding terms in this array must be primes.
Also, as the smaller prime factor of the terms on row n of A083221 is constant, A020639(n), and for all i < j: A246277(p_{i} * p_{j}) < A246277(p_i * p_{j+1}), the primes on any row appear in monotone order.

Examples

			The top left corner of the array:
1, 2, 3, 4, 5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...
1, 2, 3, 5, 4,  7, 11,  6, 13, 17, 10, 19,  9,  8, 23, 29, 14, 15, 31, ...
1, 2, 3, 5, 7, 11, 13, 17,  4, 19, 23,  6, 29, 31, 37, 41,  9, 43, 10, ...
1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37,  4, 41, 43, 47, 53, 59, ...
...
		

Crossrefs

Inverse permutations can be found from table A249822.
Row k+1 is a left-to-right composition of the first k rows of A251721.
Row 1: A000027 (an identity permutation), Row 2: A064216, Row 3: A249823, Row 4: A249825.
The initial growing part of each row converges towards A008578.

Programs

Formula

A(row,col) = A246277(A083221(row,col)).
A001222(A(row,col)) = A001222(A083221(row,col)) - 1. [This follows directly from the properties of A246277.]

A249824 Permutation of natural numbers: a(n) = A078898(A003961(A003961(2*n))).

Original entry on oeis.org

1, 2, 3, 9, 4, 12, 5, 42, 17, 19, 6, 59, 7, 22, 26, 209, 8, 82, 10, 92, 31, 29, 11, 292, 41, 32, 115, 109, 13, 129, 14, 1042, 40, 39, 48, 409, 15, 49, 45, 459, 16, 152, 18, 142, 180, 52, 20, 1459, 57, 202, 54, 159, 21, 572, 63, 542, 68, 62, 23, 642, 24, 69, 213
Offset: 1

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Examples

			a(4) = 9 because of the following. 2n = 2*4 = 8 = 2^3. We replace the prime factor 2 of 8 with the next prime 3 to get 3^3, then replace 3 with 5 to get 5^3 = 125. The smallest prime factor of 125 is 5. 125 is the 9th term of A084967: 5, 25, 35, 55, 65, 85, 95, 115, 125, ..., thus a(4) = 9.
		

Crossrefs

Programs

  • Mathematica
    t = PositionIndex[FactorInteger[#][[1, 1]] & /@ Range[10^4]]; f[n_] := Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ n; Flatten@ Table[Position[Lookup[t, FactorInteger[#][[1, 1]] ], #] &[f@ f[2 n]], {n, 120}] (* Michael De Vlieger, Jul 25 2016, Version 10 *)
  • Scheme
    (define (A249824 n) (A078898 (A003961 (A003961 (* 2 n)))))

Formula

a(n) = A078898(A246278(3,n)).
As a composition of other permutations:
a(n) = A249746(A048673(n)).
a(n) = A250475(A249826(n)).
a(n) = A275716(A243071(n)).
Other identities. For all n >= 1:
a(2n) = A273669(a(n)) and a(A003961(n)) = A273664(a(n)). -- Antti Karttunen, Aug 07 2016

A249825 Permutation of natural numbers: a(n) = A246277(A084968(n)).

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 4, 41, 43, 47, 53, 59, 61, 6, 67, 71, 73, 10, 79, 83, 89, 97, 101, 103, 14, 9, 107, 109, 22, 113, 127, 15, 131, 137, 139, 26, 149, 151, 25, 157, 163, 167, 21, 173, 179, 181, 191, 34, 33, 193, 38, 35, 197, 199, 211, 223, 227, 229, 55, 233, 39, 239, 46, 241, 251, 257, 263, 269, 271, 58, 49
Offset: 1

Views

Author

Antti Karttunen, Dec 06 2014

Keywords

Crossrefs

Programs

Formula

a(n) = A246277(A084968(n)).
As a composition of other permutations:
a(n) = A249823(A250475(n)).
a(n) = A064216(A249745(A250475(n))). [Composition of the first three rows of array A251721.]

A199593 Numbers n such that 3n-2, 3n-1 and 3n are all composite.

Original entry on oeis.org

9, 12, 17, 19, 22, 26, 29, 31, 32, 39, 40, 41, 42, 45, 48, 49, 52, 54, 57, 59, 62, 63, 68, 69, 70, 72, 73, 74, 79, 82, 83, 85, 87, 89, 92, 96, 97, 99, 100, 101, 102, 107, 108, 109, 110, 112, 114, 115, 119, 121, 122, 124, 126, 129, 131, 132, 135, 136, 138, 139, 142, 143, 146, 149, 151, 152, 157, 158, 159, 161, 162, 165, 166, 169, 171, 172, 173, 176, 177, 178
Offset: 1

Views

Author

N. J. A. Sloane, Nov 08 2011

Keywords

Comments

From Antti Karttunen, Apr 17 2015: (Start)
Other, equivalent definitions:
Numbers n such that A007310(n) is composite, from which it follows that the function c(1) = 0, c(n) = 1-A075743(n-1) is the characteristic function of this sequence.
Numbers n such that A084967(n) has at least three prime factors (when counted with bigomega, A001222).
Numbers n such that A249823(n) is composite.
(End)
There are n - pi(3n) + 1 terms in this sequence up to n; with an efficient algorithm for pi(x) this allows isolated large values to be computed. Using David Baugh and Kim Walisch's calculation that pi(10^27) = 16352460426841680446427399 one can see that a(316980872906491652886905934) = 333333333333333333333333333 (since 999999999999999999999999997 is composite). - Charles R Greathouse IV, Sep 13 2016

References

Crossrefs

Programs

  • Magma
    [n: n in [1..200] | not IsPrime(3*n) and not IsPrime(3*n-1) and not IsPrime(3*n-2)]; // Vincenzo Librandi, Apr 18 2015
    
  • Maple
    remove(t -> isprime(3*t-1 - (t mod 2)),{$2..2000}); # Robert Israel, Apr 17 2015
  • Mathematica
    Select[Range[200], Union[PrimeQ[{3# - 2, 3# - 1, 3#}]] == {False} &] (* Alonso del Arte, Jul 06 2013 *)
  • PARI
    is(n)=!isprime(bitor(3*n-2,1)) && n>1 \\ Charles R Greathouse IV, Oct 27 2013
    (Scheme, after Greathouse's PARI-program above, requiring also Antti Karttunen's IntSeq-library)
    (define A199593 (MATCHING-POS 1 2 (lambda (n) (not (prime? (A003986bi (+ n n n -2) 1)))))) ;; A003986bi implements binary inclusive or (A003986).
    ;; Antti Karttunen, Apr 17 2015
    
  • Python
    from sympy import isprime
    def ok(n): return n > 0 and not any(isprime(3*n-i) for i in [2, 1, 0])
    print([k for k in range(179) if ok(k)]) # Michael S. Branicky, Apr 16 2022

Formula

((1+(-1)^k)((-1)^n)(2n+3)+2k(6n+9+(-1)^n)+((-1)^k)+(12n^2)+36n+29)/4 n,k are all natural numbers and zero. - Bogart B. Strauss, Jul 10 2013
a(n) = n + 3n/log n + o(n/log n). - Charles R Greathouse IV, Oct 27 2013, corrected Aug 07 2016
Showing 1-8 of 8 results.