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.

Previous Showing 11-17 of 17 results.

A246280 a(n) = the smallest starting value for k such that n will be the exact number of additional iterations of A003961 needed when we start from A003961(k) before we first reach a number of the form 4k+1; the least k such that A246271(k) = n.

Original entry on oeis.org

1, 2, 5, 66, 91, 55, 21, 46, 1362, 1654, 1419, 574, 6463, 5263, 4607, 3497, 589843, 430261, 574823, 567583, 554111, 545869, 20490043, 14635735, 8781429
Offset: 0

Views

Author

Antti Karttunen, Aug 22 2014

Keywords

Comments

The sequence is infinite (well-defined for all n), provided that A246271 is not bounded.
All the terms are squarefree (see the comment in A246259).
From 2 onward their prime factorizations are: 2, 5, 2*3*11, 7*13, 5*11, 3*7, 2*23, 2*3*227, 2*827, 3*11*43, 2*7*41, 23*281, 19*277, 17*271, 13*269, 571*1033, 13*23*1439, 563*1021, 557*1019, 547*1013, 541*1009, 7*2927149, 5*2927147, 3*2927143. (Note that 2927149 = A000040(211943)).
Note how A003961(21) = 55 and A003961(55) = 91. Also A003961(545869) = 554111, A003961(554111) = 567583, A003961(567583) = 574823.
Similarly: A003961(8781429) = 14635735 and A003961(14635735) = 20490043.
Apart from those descending subsections, the growth rate of the sequence should be roughly a(n) ~ 2^n, assuming that the distribution of 4k+1 (A002144) and 4k+3 primes (A002145) among the primes is even and essentially random.

Examples

			a(0) = 1, because 1 is the first such number >= 1 that no iterations are needed before A003961(1) (= 1) is of the form 4k+1.
a(1) = 2, because 2 is the first such number >= 1 that exactly one additional iteration of A003961 is needed before A003961(2) = 3 is of the form 4k+1; as A003961(3) = 5.
a(2) = 5, because 5 is the first such number that 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.
		

Crossrefs

Leftmost column of array A246259.
A246167 gives the same sequence sorted into ascending order.

Programs

A246353 If n = Sum 2^e_i, e_i distinct, then a(n) = Position of (product prime_{e_i+1}) among squarefree numbers (A005117).

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 11, 19, 6, 10, 14, 28, 23, 44, 65, 129, 8, 15, 21, 41, 34, 69, 101, 203, 48, 94, 144, 283, 233, 470, 703, 1405, 9, 17, 26, 49, 40, 80, 120, 236, 57, 111, 168, 334, 279, 554, 833, 1661, 89, 176, 261, 521, 438, 873, 1304, 2610, 609, 1217, 1827, 3650, 3046, 6091, 9131
Offset: 0

Views

Author

Antti Karttunen, Aug 23 2014

Keywords

Comments

This is an inverse function to A048672. Note the indexing: here the domain starts from 0, but the range starts from 1, while in A048672 it is the opposite.
Sequence is obtained when the range of A019565 is compacted so that it becomes surjective on N, thus the logarithmic scatter plots look very similar. (Same applies to A064273). Compare also to the plot of A005940.

Crossrefs

Programs

  • PARI
    allocatemem(234567890);
    default(primelimit, 2^22)
    uplim_for_13928 = 13123111;
    v013928 = vector(uplim_for_13928); A013928(n) = v013928[n];
    v013928[1]=0; n=1; while((n < uplim_for_13928), if(issquarefree(n), v013928[n+1] = v013928[n]+1, v013928[n+1] = v013928[n]); n++);
    A019565(n) = {factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
    A246353(n) = 1+A013928(A019565(n));
    for(n=0, 478, write("b246353.txt", n, " ", A246353(n)));
    
  • Python
    from math import prod, isqrt
    from sympy import prime, mobius
    def A246353(n):
        m = prod(prime(i) for i,j in enumerate(bin(n)[-1:1:-1],1) if j=='1')
        return int(sum(mobius(k)*(m//k**2) for k in range(1, isqrt(m)+1))) # Chai Wah Wu, Feb 22 2025
  • Scheme
    (definec (A246353 n) (let loop ((n n) (i 1) (p 1)) (cond ((zero? n) (A013928 (+ 1 p))) ((odd? n) (loop (/ (- n 1) 2) (+ 1 i) (* p (A000040 i)))) (else (loop (/ n 2) (+ 1 i) p)))))
    

Formula

a(n) = A013928(1+A019565(n)) = 1 + A013928(A019565(n)).
a(n) = A064273(n) + 1.
For all n >= 0, A048672(a(n)) = n.
For all n >= 1, a(A048672(n)) = n.

A331835 Replace 2^k in binary expansion of n with k-th prime number for any k > 0 (and keep 2^0).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 28 2020

Keywords

Comments

Every nonnegative integer appears in this sequence as A008578 is a complete sequence.
For any m >= 0, m appears A036497(m) times, the first and last occurrences being at indices A345297(m) and A200947(m), respectively. - Rémy Sigrist, Jun 13 2021

Examples

			For n = 43:
- 43 = 2^0 + 2^1 + 2^3 + 2^5,
- so a(43) = 2^0 + prime(1) + prime(3) + prime(5) = 1 + 2 + 5 + 11 = 19.
		

Crossrefs

Programs

  • Mathematica
    Array[Total@ Map[If[# == 0, 1, Prime[#]] &, Position[Reverse@ IntegerDigits[#, 2], 1][[All, 1]] - 1] &, 68] (* Michael De Vlieger, Jan 29 2020 *)
  • PARI
    a(n) = my (b=Vecrev(binary(n\2))); n%2 + sum(k=1, #b, if (b[k], prime(k), 0))
    
  • Python
    from sympy import prime
    def p(n): return prime(n) if n >= 1 else 1
    def a(n): return sum(p(i)*int(b) for i, b in enumerate(bin(n)[:1:-1]))
    print([a(n) for n in range(69)]) # Michael S. Branicky, Jun 13 2021

Formula

a(2*n) = A089625(n) for any n > 0.
a(2*n+1) = A089625(n) + 1 for any n > 0.
G.f.: x/(1 - x^2) + (1/(1 - x)) * Sum_{k>=1} prime(k) * x^(2^k) / (1 + x^(2^k)). - Ilya Gutkovskiy, May 24 2024

A376413 a(n) = A276085(A048103(n)), where A276085 is the primorial base log-function, and A048103 is the range of the primorial base exp-function (A276086).

Original entry on oeis.org

0, 1, 2, 6, 3, 30, 4, 7, 210, 2310, 31, 8, 30030, 5, 510510, 32, 211, 9699690, 12, 2311, 223092870, 9, 6469693230, 212, 30031, 36, 200560490130, 510511, 2312, 7420738134810, 33, 304250263527210, 10, 9699691, 13082761331670030, 60, 13, 30032, 614889782588491410, 216, 510512, 223092871, 32589158477190044730
Offset: 1

Views

Author

Antti Karttunen, Nov 13 2024

Keywords

Comments

Permutation of nonnegative integers.

Crossrefs

Cf. A376411 (inverse permutation, but note the different offsets and ranges).
Cf. also A048672 (analogous permutation for base-2).

Programs

  • PARI
    A276085(n) = { my(f = factor(n), pr=1, i=1, s=0); for(k=1, #f~, while(i <= primepi(f[k, 1])-1, pr *= prime(i); i++); s += f[k, 2]*pr); (s); };
    A359550(n) = { my(pp); forprime(p=2, , pp = p^p; if(!(n%pp), return(0)); if(pp > n, return(1))); }; \\ Antti Karttunen, Nov 13 2024
    for(n=1,105,if(A359550(n),print1(A276085(n),", ")));

Formula

a(n) = A276085(A048103(n)).
For all n >= 1, A376411(a(n)) = n-1.

A318363 Multiplicative with a(prime(i)^k) = prime(k)^2^(i-1).

Original entry on oeis.org

1, 2, 4, 3, 16, 8, 256, 5, 9, 32, 65536, 12, 4294967296, 512, 64, 7, 18446744073709551616, 18, 340282366920938463463374607431768211456, 48, 1024, 131072, 115792089237316195423570985008687907853269984665640564039457584007913129639936, 20, 81, 8589934592, 25
Offset: 1

Views

Author

Rémy Sigrist, Aug 24 2018

Keywords

Comments

This sequence has similarities with A048767.
This sequence is injective (all terms are distinct).
This sequence is a permutation of A268375.

Crossrefs

Programs

  • Mathematica
    Array[Apply[Times, FactorInteger[#] /. {p_, k_} /; p > 1 :> Prime[k]^2^(PrimePi[p] - 1)] &, 27] /. {1, 1} -> 1 (* Michael De Vlieger, Aug 25 2018 *)
  • PARI
    a(n) = my (f=factor(n)); prod(i=1, #f~, prime(f[i,2])^2^(primepi(f[i,1])-1))

Formula

A007947(a(n)) = A007947(A048767(n)) for any n > 0.
a(A005117(n)) = 2^A048672(n) for any n > 0.

A048676 Binary encoding of factorizations, alternative 2, a(n) = bef2(n);.

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 8, 4, 4, 5, 16, 4, 32, 9, 6, 8, 64, 5, 128, 6, 10, 17, 256, 6, 8, 33, 8, 10, 512, 7, 1024, 16, 18, 65, 12, 6, 2048, 129, 34, 8, 4096, 11, 8192, 18, 8, 257, 16384, 10, 16, 9, 66, 34, 32768, 9, 20, 12, 130, 513, 65536, 8, 131072, 1025, 12, 32, 36, 19
Offset: 1

Views

Author

Antti Karttunen, Jul 14 1999

Keywords

Comments

Gives same values as A048675 if the source sequence is squarefree (A048672), or there are max two prime divisors or one p with max exponent being 2 (A048623 and A048639).

Crossrefs

Cf. A048675.

Programs

  • Maple
    bef2 := proc(n) local s,d; s := 0; for d in ifactors(n)[ 2 ] do s := s + (2^(nthprime(d[ 1 ])+d[ 2 ]-2)); od; RETURN(s); end; # for nthprime see A048675
  • PARI
    a(n) = {if (n==1, return (0)); my(f = factor(n)); sum(k=1, #f~, 2^(primepi(f[k, 1])+f[k, 2]))/4;} \\ Michel Marcus, Oct 02 2015

Formula

a(1) = 0, a(n) = 1/4 * (2^(i1+e1) + 2^(i2+e2) + ... + 2^(iz+ez)) if n = p_i1^e1*p_i2^e2*...*p_iz^ez, where p_i is i-th prime. (e.g. p1=2, p2=3).

A307544 Irregular triangle read by rows: T(n,k) = A087207(A307540(n,k)).

Original entry on oeis.org

0, 1, 3, 2, 7, 5, 6, 4, 15, 11, 13, 9, 14, 10, 12, 8, 31, 23, 27, 19, 29, 21, 25, 30, 17, 22, 26, 18, 28, 20, 24, 16, 63, 47, 55, 59, 39, 43, 51, 61, 35, 45, 53, 57, 37, 62, 41, 49, 46, 54, 33, 58, 38, 42, 50, 60, 34, 44, 52, 56, 36, 40, 48, 32, 127, 95, 111, 119
Offset: 0

Views

Author

Michael De Vlieger, Apr 19 2019

Keywords

Comments

Let gpf(m) = A006530(m) and let phi(m) = A000010(m) for m in A005117.
Row n contains m in A005117 such that A006530(m) = n, sorted such that phi(m)/m increases as k increases.
Let m be the squarefree kernel A007947(m') of m'. We only consider squarefree m since phi(m)/m = phi(m')/m'. Let prime p | n and prime q be a nondivisor of n.
Since m is squarefree, we might encode the multiplicities of its prime divisors in a positional notation M that is finite at n significant digits. For example, m = 42 can be encoded reverse(A067255(42)) = 1,0,1,1 = 7^1 * 5^0 * 3^1 * 2^1. It is necessary to reverse row m of A067255 (hereinafter simply A067255(m)) so as to preserve zeros in M = A067255(m) pertaining to small nondivisor primes q < p. The code M is a series of 0's and 1's since m is squarefree. Then it is clear that row n contains all m such that A067255(m) has n terms, and there are 2^(n - 1) possible terms for n >= 1.
We may use an approach that generates the binary expansion of the range 2^(n - 1) < M < 2^n - 1, or we may append 1 to the reversed (n - 1)-tuples of {1, 0} (as A059894) to achieve codes M -> m for each row n.
Originally it was thought that the codes M were in order of the latter algorithm, and we could avoid sorting. Observation shows that the m still require sorting by the function phi(m)/m indeed to be in increasing order in row n. Still, the latter approach is slightly more efficient than the former in generating the sequence.
This sequence interprets the code M as a binary value. The sequence is a permutation of the natural numbers since the ratio phi(m)/m is unique for squarefree m.
This sequence and A059894 are identical for 1 <= n <= 23.
Numbers of terms in rows n of this sequence and A059894 (partitioned by powers of 2) that are coincident: 1, 2, 4, 8, 14, 14, 10, 26, 14, 20, 10, 16, 22, 12, 18, 18, 16, 14, 18, 18, 18, 14, 16, ...}.
The graphs of this sequence and A059894 are similar.
The graph of this sequence feature squares of size 2^(j-1) at (x,y) = (h,h) where h = 2^j, integers, that have pi-radian rotational symmetry.

Examples

			First terms of this sequence appear bottom to top in the chart below. The values of n appear in the header, values m = T(n,k) followed parenthetically by phi(m)/m appear in column n. In square brackets, we write the multiplicities of primes in positional order with the smallest prime at right (big-endian). The x axis plots k according to primepi(gpf(m)), while the y axis plots k according to phi(m)/m:
    0       1          2             3             4
    .       .          .             .             .
--- 1 ------------------------------------------------
  (1/1)     .          .             .             .
   [0]      .          .             .             .
    .       .          .             .             .
    .       .          .             .             7
    .       .          .             5           (6/7)
    .       .          .           (4/5)        [1000]
    .       .          .           [100]           .
    .       .          .             .            35
    .       .          3             .          (24/35)
    .       .        (2/3)           .          [1100]
    .       .        [10]            .             .
    .       .          .             .             .
    .       .          .             .            21
    .       .          .             .           (4/7)
    .       .          .            15          [1010]
    .       .          .          (8/15)           .
    .       2          .           [110]           .
    .     (1/2)        .             .             .
    .      [1]         .             .            105
    .       .          .             .          (16/35)
    .       .          .             .          [1110]
    .       .          .             .            14
    .       .          .            10           (3/7)
    .       .          .           (2/5)        [1001]
    .       .          .           [101]           .
    .       .          .             .            70
    .       .          6             .          (12/35)
    .       .        (1/3)           .          [1101]
    .       .        [11]            .            42
    .       .          .            30           (2/7)
    .       .          .          (4/15)        [1011]
    .       .          .           [111]          210
    .       .          .             .           (8/35)
    .       .          .             .          [1111]
...
a(1) = 0 since T(0,1) = 1 = empty product.
a(2) = 1 since T(1,1) = 2 = 2^1 -> binary "1" = decimal 1.
a(3) = 3 since T(2,1) = 6 = 2^1 * 3^1 -> binary "11" = decimal 3.
a(4) = 2 since T(2,2) = 3 = 2^0 * 3^1 -> binary "10" = decimal 2.
a(5) = 7 since T(3,1) = 30 = 2^1 * 3^1 * 5^1 -> binary "111" = decimal 7, etc.
Graph of first 32 terms: (Start)
              x
                       x
                   x
                           x
                 x
                         x
                     x
                x
                             x
                        x
                    x
                            x
                  x
                          x
                      x
                              x
       x
           x
         x
             x
        x
            x
          x
              x
   x
     x
    x
      x
x
  x
x
(End)
From _Antti Karttunen_, Jan 10 2020: (Start)
Arranged as a binary tree:
                                       0
                                       |
                    ...................1...................
                   3                                       2
         7......../ \........5                   6......../ \........4
        / \                 / \                 / \                 / \
       /   \               /   \               /   \               /   \
      /     \             /     \             /     \             /     \
    15       11         13       9          14       10         12       8
  31  23   27  19     29  21   25 30      17  22   26  18     28  20   24 16
etc.
(End)
		

Crossrefs

Programs

  • Mathematica
    Prepend[Array[SortBy[#, Last] &@ Map[{#2, EulerPhi[#1]/#1} & @@ {Times @@  MapIndexed[Prime[First@ #2]^#1 &, Reverse@ #], FromDigits[#, 2]} &, Map[Prepend[Reverse@ #, 1] &, Tuples[{1, 0}, # - 1]]] &, 7], {{0, 0, 1}}][[All, All, 1]] // Flatten
  • PARI
    up_to = 1023;
    rat(n) = { my(m=1, p=2); while(n, if(n%2, m *= (p-1)/p); n >>= 1; p = nextprime(1+p)); (m); };
    cmpA307544(a,b) = if(!a,sign(-b),if(!b,sign(a), my(as=logint(a,2), bs=logint(b,2)); if(as!=bs, sign(as-bs), sign(rat(a)-rat(b)))));
    A307544list(up_to) = vecsort(vector(1+up_to,n,n-1), cmpA307544);
    v307544 = A307544list(up_to);
    A307544(n) = v307544[1+n]; \\ Antti Karttunen, Jan 10 2020

Formula

For n > 0, row lengths = 2^(n - 1).
T(n,1) = 2^n - 1 = A000225(n).
T(n,2^(n - 1)) = 2^(n - 1).
Previous Showing 11-17 of 17 results.