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

A324400 Lexicographically earliest sequence such that a(i) = a(j) => f(i) = f(j) for all i, j >= 1, where f(n) = -1 if n = 2^k and k > 0, and f(n) = n for all other numbers.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 01 2019

Keywords

Comments

In the following, A stands for this sequence, A324400, and S -> T (where S and T are sequence A-numbers) indicates that for all i, j >= 1: S(i) = S(i) => T(i) = T(j).
For example, the following chains of implications hold:
A -> A286619 -> A005811,
and
A -> A003602 -> A286622 -> A000120,
-> A323889,
-> A000593,
-> A001227,
among many others.

Crossrefs

Programs

  • PARI
    A000523(n) = if(n<1, 0, #binary(n)-1);
    A324400(n) = if(n<4,n,if(!bitand(n,n-1),2,1+n-A000523(n)));

Formula

If n <= 3, a(n) = n; and for n >= 4, if A209229(n) = 1, then a(n) = 2, otherwise a(n) = 1 + n - A000523(n).

A283477 If 2n = 2^e1 + 2^e2 + ... + 2^ek [e1 .. ek distinct], then a(n) = A002110(e1) * A002110(e2) * ... * A002110(ek).

Original entry on oeis.org

1, 2, 6, 12, 30, 60, 180, 360, 210, 420, 1260, 2520, 6300, 12600, 37800, 75600, 2310, 4620, 13860, 27720, 69300, 138600, 415800, 831600, 485100, 970200, 2910600, 5821200, 14553000, 29106000, 87318000, 174636000, 30030, 60060, 180180, 360360, 900900, 1801800, 5405400, 10810800, 6306300, 12612600, 37837800, 75675600
Offset: 0

Views

Author

Antti Karttunen, Mar 16 2017

Keywords

Comments

a(n) = Product of distinct primorials larger than one, obtained as Product_{i} A002110(1+i), where i ranges over the zero-based positions of the 1-bits present in the binary representation of n.
This sequence can be represented as a binary tree. Each child to the left is obtained as A283980(k), and each child to the right is obtained as 2*A283980(k), when their parent contains k:
1
|
...................2....................
6 12
30......../ \........60 180......../ \......360
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
210 420 1260 2520 6300 12600 37800 75600
etc.

Crossrefs

Programs

  • Mathematica
    Table[Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e == 1 :> {Times @@ Prime@ Range@ PrimePi@ p, e}] &[Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[n, 2]], {n, 0, 43}] (* Michael De Vlieger, Mar 18 2017 *)
  • PARI
    A283477(n) = prod(i=0,exponent(n),if(bittest(n,i),vecprod(primes(1+i)),1)) \\ Edited by M. F. Hasler, Nov 11 2019
    
  • Python
    from sympy import prime, primerange, factorint
    from operator import mul
    from functools import reduce
    def P(n): return reduce(mul, [i for i in primerange(2, n + 1)])
    def a108951(n):
        f = factorint(n)
        return 1 if n==1 else reduce(mul, [P(i)**f[i] for i in f])
    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 # after Chai Wah Wu
    def a(n): return a108951(a019565(n))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 22 2017
    
  • Python
    from sympy import primorial
    from math import prod
    def A283477(n): return prod(primorial(i) for i, b in enumerate(bin(n)[:1:-1],1) if b =='1') # Chai Wah Wu, Dec 08 2022
  • Scheme
    (define (A283477 n) (A108951 (A019565 n)))
    ;; Recursive "binary tree" implementation, using memoization-macro definec:
    (definec (A283477 n) (cond ((zero? n) 1) ((even? n) (A283980 (A283477 (/ n 2)))) (else (* 2 (A283980 (A283477 (/ (- n 1) 2)))))))
    

Formula

a(0) = 1; a(2n) = A283980(a(n)), a(2n+1) = 2*A283980(a(n)).
Other identities. For all n >= 0 (or for n >= 1):
a(2n+1) = 2*a(2n).
a(n) = A108951(A019565(n)).
A097248(a(n)) = A283475(n).
A007814(a(n)) = A051903(a(n)) = A000120(n).
A001221(a(n)) = A070939(n).
A001222(a(n)) = A029931(n).
A048675(a(n)) = A005187(n).
A248663(a(n)) = A006068(n).
A090880(a(n)) = A283483(n).
A276075(a(n)) = A283984(n).
A276085(a(n)) = A283985(n).
A046660(a(n)) = A124757(n).
A056169(a(n)) = A065120(n). [seems to be]
A005361(a(n)) = A284001(n).
A072411(a(n)) = A284002(n).
A007913(a(n)) = A284003(n).
A000005(a(n)) = A284005(n).
A324286(a(n)) = A324287(n).
A276086(a(n)) = A324289(n).
A267263(a(n)) = A324341(n).
A276150(a(n)) = A324342(n). [subsequences in the latter are converging towards this sequence]
G.f.: Product_{k>=0} (1 + prime(k + 1)# * x^(2^k)), where prime()# = A002110. - Ilya Gutkovskiy, Aug 19 2019

Extensions

More formulas and the binary tree illustration added by Antti Karttunen, Mar 19 2017
Four more linking formulas added by Antti Karttunen, Feb 25 2019

A324344 Lexicographically earliest positive sequence such that a(i) = a(j) => A000120(i) = A000120(j) and A324342(i) = A324342(j), for all i, j >= 0.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 24 2019

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A000120(n), A324342(n)].

Crossrefs

Cf. also A318310.

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A002110(n) = prod(i=1,n,prime(i));
    A030308(n,k) = bittest(n,k);
    A283477(n) = prod(i=0,#binary(n),if(0==A030308(n,i),1,A030308(n,i)*A002110(1+i)));
    A276150(n) = { my(s=0,m); forprime(p=2, , if(!n, return(s)); m = n%p; s += m; n = (n-m)/p); };
    A324342(n) = A276150(A283477(n));
    A324344aux(n) = [hammingweight(n), A324342(n)];
    v324344 = rgs_transform(vector(1+up_to,n,A324344aux(n-1)));
    A324344(n) = v324344[1+n];

A324390 Lexicographically earliest positive sequence such that a(i) = a(j) => A278219(i) = A278219(j) and A324386(i) = A324386(j), for all i, j >= 0.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 27 2019

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A278219(n), A324386(n)].

Crossrefs

Cf. also A286619, A324343, A324344, A324380 (compare the scatter-plots).

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ From A005940
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ From A046523
    A278222(n) = A046523(A005940(1+n));
    A003188(n) = bitxor(n, n>>1);
    A278219(n) = A278222(A003188(n));
    Aux324390(n) = [A278219(n), A324386(n)]; \\ See code for A324386 in that entry.
    v324390 = rgs_transform(vector(1+up_to,n,Aux324390(n-1)));
    A324390(n) = v324390[1+n];

Formula

a(A000225(n)) = 2 for all n >= 1.

A324345 Lexicographically earliest positive sequence such that a(i) = a(j) => A005811(i) = A005811(j) and A278222(i) = A278222(j), for all i, j >= 0.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 24 2019

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A005811(n), A278222(n)], or equally, of [A005811(n), A286622(n)].
For all i, j >= 1:
a(i) = a(j) => A033264(i) = A033264(j).

Crossrefs

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A005811(n) = hammingweight(bitxor(n, n>>1)); \\ From A005811
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A278222(n) = A046523(A005940(1+n));
    Aux324345(n) = [A005811(n), A278222(n)];
    v324345 = rgs_transform(vector(1+up_to,n,Aux324345(n-1)));
    A324345(n) = v324345[1+n];

Formula

a(2^n) = 3 for all n >= 1.

A324380 Lexicographically earliest positive sequence such that a(i) = a(j) => A069010(i) = A069010(j) and A324386(i) = A324386(j), for all i, j >= 0.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 27 2019

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A069010(n), A324386(n)].

Crossrefs

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A069010(n) = ((1 + (hammingweight(bitxor(n, n>>1)))) >> 1); \\ From A069010
    Aux324380(n) = [A069010(n), A324386(n)]; \\ Code for A324386 available in that entry.
    v324380 = rgs_transform(vector(1+up_to,n,Aux324380(n-1)));
    A324380(n) = v324380[1+n];

Formula

a(A000225(n)) = 2 for all n >= 1.

A324725 a(n) = sign(A324543(n)) * A001511(A324543(n)), with a(n) = 0 if A324543(n) = 0.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 17 2019

Keywords

Crossrefs

Programs

Formula

If A324543(n) = 0, then a(n) = 0, otherwise a(n) = sign(A324543(n)) * A001511(A324543(n)).
a(p) = 1 for all primes p.
A324828(n) = [1 == abs(a(n))], where [ ] is the Iverson bracket.
Showing 1-7 of 7 results.