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

A019565 The squarefree numbers ordered lexicographically by their prime factorization (with factors written in decreasing order). a(n) = Product_{k in I} prime(k+1), where I is the set of indices of nonzero binary digits in n = Sum_{k in I} 2^k.

Original entry on oeis.org

1, 2, 3, 6, 5, 10, 15, 30, 7, 14, 21, 42, 35, 70, 105, 210, 11, 22, 33, 66, 55, 110, 165, 330, 77, 154, 231, 462, 385, 770, 1155, 2310, 13, 26, 39, 78, 65, 130, 195, 390, 91, 182, 273, 546, 455, 910, 1365, 2730, 143, 286, 429, 858, 715, 1430, 2145, 4290
Offset: 0

Views

Author

Keywords

Comments

A permutation of the squarefree numbers A005117. The missing positive numbers are in A013929. - Alois P. Heinz, Sep 06 2014
From Antti Karttunen, Apr 18 & 19 2017: (Start)
Because a(n) toggles the parity of n there are neither fixed points nor any cycles of odd length.
Conjecture: there are no finite cycles of any length. My grounds for this conjecture: any finite cycle in this sequence, if such cycles exist at all, must have at least one member that occurs somewhere in A285319, the terms that seem already to be quite rare. Moreover, any such a number n should satisfy in addition to A019565(n) < n also that A048675^{k}(n) is squarefree, not just for k=0, 1 but for all k >= 0. As there is on average a probability of only 6/(Pi^2) = 0.6079... that any further term encountered on the trajectory of A048675 is squarefree, the total chance that all of them would be squarefree (which is required from the elements of A019565-cycles) is soon minuscule, especially as A048675 is not very tightly bounded (many trajectories seem to skyrocket, at least initially). I am also assuming that usually there is no significant correlation between the binary expansions of n and A048675(n) (apart from their least significant bits), or, for that matter, between their prime factorizations.
See also the slightly stronger conjecture in A285320, which implies that there would neither be any two-way infinite cycles.
If either of the conjectures is false (there are cycles), then certainly neither sequence A285332 nor its inverse A285331 can be a permutation of natural numbers. (End)
The conjecture made in A087207 (see also A288569) implies the two conjectures mentioned above. A further constraint for cycles is that in any A019565-trajectory which starts from a squarefree number (A005117), every other term is of the form 4k+2, while every other term is of the form 6k+3. - Antti Karttunen, Jun 18 2017
The sequence satisfies the exponential function identity, a(x + y) = a(x) * a(y), whenever x and y do not have a 1-bit in the same position, i.e., when A004198(x,y) = 0. See also A283475. - Antti Karttunen, Oct 31 2019
The above identity becomes unconditional if binary exclusive OR, A003987(.,.), is substituted for addition, and A059897(.,.), a multiplicative equivalent of A003987, is substituted for multiplication. This gives us a(A003987(x,y)) = A059897(a(x), a(y)). - Peter Munn, Nov 18 2019
Also the Heinz number of the binary indices of n, where the Heinz number of a sequence (y_1,...,y_k) is prime(y_1)*...*prime(y_k), and a number's binary indices (A048793) are the positions of 1's in its reversed binary expansion. - Gus Wiseman, Dec 28 2022

Examples

			5 = 2^2+2^0, e_1 = 2, e_2 = 0, prime(2+1) = prime(3) = 5, prime(0+1) = prime(1) = 2, so a(5) = 5*2 = 10.
From _Philippe Deléham_, Jun 03 2015: (Start)
This sequence regarded as a triangle withs rows of lengths 1, 1, 2, 4, 8, 16, ...:
   1;
   2;
   3,  6;
   5, 10, 15, 30;
   7, 14, 21, 42, 35,  70, 105, 210;
  11, 22, 33, 66, 55, 110, 165, 330, 77, 154, 231, 462, 385, 770, 1155, 2310;
  ...
(End)
From _Peter Munn_, Jun 14 2020: (Start)
The initial terms are shown below, equated with the product of their prime factors to exhibit the lexicographic order. We start with 1, since 1 is factored as the empty product and the empty list is first in lexicographic order.
   n     a(n)
   0     1 = .
   1     2 = 2.
   2     3 = 3.
   3     6 = 3*2.
   4     5 = 5.
   5    10 = 5*2.
   6    15 = 5*3.
   7    30 = 5*3*2.
   8     7 = 7.
   9    14 = 7*2.
  10    21 = 7*3.
  11    42 = 7*3*2.
  12    35 = 7*5.
(End)
		

Crossrefs

Row 1 of A285321.
Equivalent sequences for k-th-power-free numbers: A101278 (k=3), A101942 (k=4), A101943 (k=5), A054842 (k=10).
Cf. A109162 (iterates).
Cf. also A048675 (a left inverse), A087207, A097248, A260443, A054841.
Cf. A285315 (numbers for which a(n) < n), A285316 (for which a(n) > n).
Cf. A276076, A276086 (analogous sequences for factorial and primorial bases), A334110 (terms squared).
For partial sums see A288570.
A003961, A003987, A004198, A059897, A089913, A331590, A334747 are used to express relationships between sequence terms.
Column 1 of A329332.
Even bisection (which contains the odd terms): A332382.
A160102 composed with A052330, and subsequence of the latter.
Related to A000079 via A225546, to A057335 via A122111, to A008578 via A336322.
Least prime index of a(n) is A001511.
Greatest prime index of a(n) is A029837 or A070939.
Taking prime indices gives A048793, reverse A272020, row sums A029931.
A112798 lists prime indices, length A001222, sum A056239.

Programs

  • Haskell
    a019565 n = product $ zipWith (^) a000040_list (a030308_row n)
    -- Reinhard Zumkeller, Apr 27 2013
    
  • Maple
    a:= proc(n) local i, m, r; m:=n; r:=1;
          for i while m>0 do if irem(m,2,'m')=1
            then r:=r*ithprime(i) fi od; r
        end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Sep 06 2014
  • Mathematica
    Do[m=1;o=1;k1=k;While[ k1>0, k2=Mod[k1, 2];If[k2\[Equal]1, m=m*Prime[o]];k1=(k1-k2)/ 2;o=o+1];Print[m], {k, 0, 55}] (* Lei Zhou, Feb 15 2005 *)
    Table[Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[n, 2], {n, 0, 55}]  (* Michael De Vlieger, Aug 27 2016 *)
    b[0] := {1}; b[n_] := Flatten[{ b[n - 1], b[n - 1] * Prime[n] }];
      a = b[6] (* Fred Daniel Kline, Jun 26 2017 *)
  • PARI
    a(n)=factorback(vecextract(primes(logint(n+!n,2)+1),n))  \\ M. F. Hasler, Mar 26 2011, updated Aug 22 2014, updated Mar 01 2018
    
  • Python
    from operator import mul
    from functools import reduce
    from sympy import prime
    def A019565(n):
        return reduce(mul,(prime(i+1) for i,v in enumerate(bin(n)[:1:-1]) if v == '1')) if n > 0 else 1
    # Chai Wah Wu, Dec 25 2014
    
  • Scheme
    (define (A019565 n) (let loop ((n n) (i 1) (p 1)) (cond ((zero? n) p) ((odd? n) (loop (/ (- n 1) 2) (+ 1 i) (* p (A000040 i)))) (else (loop (/ n 2) (+ 1 i) p))))) ;; (Requires only the implementation of A000040 for prime numbers.) - Antti Karttunen, Apr 20 2017

Formula

G.f.: Product_{k>=0} (1 + prime(k+1)*x^2^k), where prime(k)=A000040(k). - Ralf Stephan, Jun 20 2003
a(n) = f(n, 1, 1) with f(x, y, z) = if x > 0 then f(floor(x/2), y*prime(z)^(x mod 2), z+1) else y. - Reinhard Zumkeller, Mar 13 2010
For all n >= 0: A048675(a(n)) = n; A013928(a(n)) = A064273(n). - Antti Karttunen, Jul 29 2015
a(n) = a(2^x)*a(2^y)*a(2^z)*... = prime(x+1)*prime(y+1)*prime(z+1)*..., where n = 2^x + 2^y + 2^z + ... - Benedict W. J. Irwin, Jul 24 2016
From Antti Karttunen, Apr 18 2017 and Jun 18 2017: (Start)
a(n) = A097248(A260443(n)), a(A005187(n)) = A283475(n), A108951(a(n)) = A283477(n).
A055396(a(n)) = A001511(n), a(A087207(n)) = A007947(n). (End)
a(2^n - 1) = A002110(n). - Michael De Vlieger, Jul 05 2017
a(n) = A225546(A000079(n)). - Peter Munn, Oct 31 2019
From Peter Munn, Mar 04 2022: (Start)
a(2n) = A003961(a(n)); a(2n+1) = 2*a(2n).
a(x XOR y) = A059897(a(x), a(y)) = A089913(a(x), a(y)), where XOR denotes bitwise exclusive OR (A003987).
a(n+1) = A334747(a(n)).
a(x+y) = A331590(a(x), a(y)).
a(n) = A336322(A008578(n+1)).
(End)

Extensions

Definition corrected by Klaus-R. Löffler, Aug 20 2014
New name from Peter Munn, Jun 14 2020

A048672 Binary encoding of squarefree numbers (A005117): A048640(n)/2.

Original entry on oeis.org

0, 1, 2, 4, 3, 8, 5, 16, 32, 9, 6, 64, 128, 10, 17, 256, 33, 512, 7, 1024, 18, 65, 12, 2048, 129, 34, 4096, 11, 8192, 257, 16384, 66, 32768, 20, 130, 513, 65536, 131072, 1025, 36, 19, 262144, 258, 13, 524288, 1048576, 2049, 24, 35, 2097152, 4097, 4194304, 68
Offset: 1

Views

Author

Antti Karttunen, Jul 14 1999

Keywords

Comments

Permutation of nonnegative integers. Note the indexing, the domain starts from 1, although the range includes also 0.
A246353 gives the inverse of this sequence, in a sense that a(A246353(n)) = n for all n >= 0, and A246353(a(n)) = n for all n >= 1. When one is subtracted from the latter, another permutation of nonnegative integers is obtained: A064273. - Antti Karttunen, Aug 23 2014 based on comment from Howard A. Landman, Sep 25 2001
Also index of n-th term of A019565 when its terms are sorted in increasing order. For example: a(6) = 8. The smallest values of A019565 are 1,2,3,5,6,7 . The 6th is 7 which is A019565(8). - Philippe Lallouet (philip.lallouet(AT)orange.fr), Apr 28 2008
a(n) is the number whose binary indices are the prime indices of the n-th squarefree number (row n of A329631), where a binary index of n is any position of a 1 in its reversed binary expansion, and a prime index of n is a number m such that prime(m) divides n. The binary indices of n are row n of A048793, while the prime indices of n are row n of A112798. - Gus Wiseman, Nov 30 2019

Examples

			From _Gus Wiseman_, Nov 30 2019: (Start)
The sequence of squarefree numbers together with their prime indices (A329631) and the number a(n) with those binary indices begins:
   1 ->  {}      ->   0
   2 ->  {1}     ->   1
   3 ->  {2}     ->   2
   5 ->  {3}     ->   4
   6 ->  {1,2}   ->   3
   7 ->  {4}     ->   8
  10 ->  {1,3}   ->   5
  11 ->  {5}     ->  16
  13 ->  {6}     ->  32
  14 ->  {1,4}   ->   9
  15 ->  {2,3}   ->   6
  17 ->  {7}     ->  64
  19 ->  {8}     -> 128
  21 ->  {2,4}   ->  10
  22 ->  {1,5}   ->  17
  23 ->  {9}     -> 256
  26 ->  {1,6}   ->  33
  29 ->  {10}    -> 512
  30 ->  {1,2,3} ->   7
(End)
		

Crossrefs

Inverse: A246353 (see also A064273).
Cf. A019565.
A similar encoding of set-systems is A329661.
Cf. A087207.

Programs

  • Maple
    encode_sqrfrees := proc(upto_n) local b,i; b := [ ]; for i from 1 to upto_n do if(0 <> mobius(i)) then b := [ op(b), bef(i) ]; fi; od: RETURN(b); end; # see A048623 for bef
  • Mathematica
    Join[{0}, Total[2^(PrimePi[FactorInteger[#][[All, 1]]] - 1)]& /@ Select[ Range[2, 100], SquareFreeQ]] (* Jean-François Alcover, Mar 15 2016 *)
  • PARI
    lista(nn) = {for (n=1, nn, if (issquarefree(n), if (n==1, x = 0, f = factor(n); x = sum(k=1, #f~, 2^(primepi(f[k, 1])-1))); print1(x, ", "); ); ); } \\ Michel Marcus, Oct 02 2015
    
  • Python
    from math import isqrt
    from sympy import mobius, primepi, primefactors
    def A048672(n):
        if n == 1: return 0
        def f(x): return int(n-sum(mobius(k)*(x//k**2) for k in range(2, isqrt(x)+1)))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return sum(1<Chai Wah Wu, Feb 22 2025

Formula

a(n) = 2^(i1-1)+2^(i2-1)+...+2^(iz-1), where A005117(n) = p_i1*p_i2*p_i3*...*p_iz.
A019565(a(n)) = A005117(n). - Peter Munn, Nov 19 2019
A000120(a(n)) = A072047(n). - Gus Wiseman, Nov 30 2019
a(n) = A087207(A005117(n)). - Flávio V. Fernandes, Feb 26 2025

A285329 a(n) = A013928(A007947(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 17 2017

Keywords

Comments

For n > 1, a(n) gives the (one-based) index of the column where n is located in array A284311, or respectively, index of the row where n is in A284457. A008479 gives the other index.

Crossrefs

Cf. A008479 (the other index).
Cf. array A284311 (A284457).

Programs

  • Python
    from operator import mul
    from sympy import primefactors
    from sympy.ntheory.factor_ import core
    from functools import reduce
    def a007947(n): return 1 if n<2 else reduce(mul, primefactors(n))
    def a013928(n): return sum(1 for i in range(1, n) if core(i) == i)
    print([a013928(a007947(n)) for n in range(1, 101)]) # Indranil Ghosh, Apr 18 2017
    
  • Python
    from math import prod, isqrt
    from sympy import primefactors, mobius
    def A285329(n):
        m=prod(primefactors(n))-1
        return sum(mobius(k)*(m//k**2) for k in range(1,isqrt(m)+1)) # Chai Wah Wu, May 12 2024

Formula

a(n) = A013928(A007947(n)).
Other identities. For all n >= 0:
If A008683(n) <> 0 [when n is squarefree, A005117], a(n) = A013928(n), otherwise a(n) = a(A285328(n)).
a(A019565(n)) = A064273(n).

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.

A376411 a(n) is the number of terms less than A276086(n) in the range of A276086, where A276086 is the primorial base exp-function.

Original entry on oeis.org

0, 1, 2, 4, 6, 13, 3, 7, 11, 21, 32, 64, 18, 36, 54, 108, 162, 325, 90, 180, 271, 541, 812, 1624, 450, 902, 1354, 2707, 4061, 8122, 5, 10, 15, 30, 45, 91, 25, 50, 75, 151, 227, 454, 126, 253, 378, 758, 1137, 2274, 632, 1264, 1895, 3790, 5685, 11370, 3158, 6317, 9475, 18952, 28428, 56856, 35, 70, 106, 212, 318, 637
Offset: 0

Views

Author

Antti Karttunen, Nov 13 2024

Keywords

Comments

Number of terms of A048103 that are less than A276086(n).
Permutation of nonnegative integers.
Troughs are at primorials, A002110, and the local maxima occur just before, at A057588.

Crossrefs

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

Programs

  • PARI
    up_to = (2*210)-1; \\ Must be one of the terms of A343048.
    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); };
    A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); };
    A359550(n) = { my(pp); forprime(p=2, , pp = p^p; if(!(n%pp), return(0)); if(pp > n, return(1))); };
    A376411list(up_to) = { my(size=up_to, v=vector(size), m=A276086(size), s=1, j); for(i=2,m,if(!(m%i), j=A276085(i); v[j] = s; print1("i=",i," v[",j,"]=",s", ");); s += A359550(i)); (v); };
    v376411 = A376411list(up_to);
    A376411(n) = if(!n,n,v376411[n]);
    
  • PARI
    \\ For incremental computing, less efficient than above:
    A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); };
    A359550(n) = { my(pp); forprime(p=2, , pp = p^p; if(!(n%pp), return(0)); if(pp > n, return(1))); };
    memoA376411 = Map(); \\ We use k=A276086(n) as our key. kvs will be a list of key-value-pairs sorted into descending order by the key. We search the largest key in it < k, and continue summing from that:
    A376411(n) = if(n<=2,n,my(v, k=A276086(n)); if(mapisdefined(memoA376411,k,&v), v, my(kvs = vecsort(Mat(memoA376411)~,(x,y) -> sign(y[1]-x[1])), ss=si=0); for(i=1, #kvs, if(kvs[1,i]A359550(i)); mapput(memoA376411,k,v); (v)));

Formula

a(n) = A377982(A276086(n))-1 = Sum_{i=1 .. A276086(n)-1} A359550(i).
For all n >= 1, a(A376413(n)) = n-1, and for all n >= 0, A376413(1+a(n)) = n.
a(i)/a(j) ~ A276086(i)/A276086(j), and particularly, a(2*n+1) ~ 2*a(2*n).
Showing 1-5 of 5 results.