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.

User: Leonid Broukhis

Leonid Broukhis's wiki page.

Leonid Broukhis has authored 36 sequences. Here are the ten most recent ones:

A355615 Define a rational sequence {b(n)} as b(1) = 1, b(n) = b(n-1) + 1/(n + 1 - b(n-1)) for n > 1; a(n) is the numerator of b(n).

Original entry on oeis.org

1, 3, 19, 689, 902919, 1610893922869, 5422187846648306990942459, 65408471597507349805723190837012905483968615226329
Offset: 1

Author

Leonid Broukhis, Jul 09 2022

Keywords

Comments

The next term is too large to include.

Examples

			The sequence {b(n)} begins 1, 3/2, 19/10, 689/310, 902919/363010, 1610893922869/594665194510, ...
		

Crossrefs

Cf. A079278 (denominators).

A355328 Decimal expansion of the number whose binary expansion differs from its decimal expansion only in the first digit.

Original entry on oeis.org

1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1
Offset: 0

Author

Leonid Broukhis, Jun 29 2022

Keywords

Comments

The decimal fraction 0.1 has binary expansion starting with 0.0001...; copying the suffix 001 (3 digits, as 3 < log_2(10) < 4) we obtain 0.1001, which expands to 0.00011001101, etc.
Alternatively the process can be described as greedily expressing 1/2 with digits of weights 1/2^n-1/10^n. With f(n)=1/2^n-1/10^n, 0.5 = f(1)+f(4)+f(5)+f(8)+f(9)+f(11)...

Examples

			0.100110011010000011001111010001110100101001000111010001001101001011...
		

Crossrefs

Cf. A352677 (golden base = binary).

Programs

  • Mathematica
    seq[len_] := Module[{s = Table[0, {len}], x = 1/10, n = 1, c = 0}, s[[1]] = 1; While[n < len, While[1/2^n - 1/10^n > x, n++]; c++; s[[n]] = 1; x -= (1/2^n - 1/10^n)]; s]; seq[100] (* Amiram Eldar, Jun 29 2022 *)

A269110 Numbers of unit circles packed in a triangle of smallest area admitting an equilateral triangle solution.

Original entry on oeis.org

1, 3, 5, 6, 9, 10, 14, 15, 20, 21
Offset: 1

Author

Leonid Broukhis, Feb 19 2016

Keywords

Crossrefs

May be related to A117142.
For packing into equilateral triangles, see A337019.

A269101 Numbers of circles with the largest possible sum of radii packed inside an ellipse admitting circular solution.

Original entry on oeis.org

1, 6, 7, 8, 9, 12, 16, 19, 22, 27
Offset: 1

Author

Leonid Broukhis, Feb 19 2016

Keywords

A220001 Benes network size for permutations of n.

Original entry on oeis.org

0, 1, 3, 6, 8, 12, 15, 20, 22, 26, 30, 36, 39, 44, 49, 56, 58, 62, 66, 72, 76, 82, 88, 96, 99, 104, 109, 116, 121, 128, 135, 144, 146, 150, 154, 160, 164, 170, 176, 184, 188, 194, 200, 208, 214, 222, 230, 240, 243, 248, 253, 260, 265, 272, 279, 288, 293, 300
Offset: 1

Author

Leonid Broukhis, Dec 03 2012

Keywords

Comments

a(n) is the number of 2 X 2 direct/crisscross switches required to construct an n X n crossbar for any permutation.

Examples

			n=1 does not need any switches, n=2 needs just one 2 X 2 switch, n=3 needs three switches (1 X 2, 2 X 3, 1 X 2).
		

Programs

Formula

a(n) = 2*floor(n/2) + a(floor(n/2)) + a(ceiling(n/2)) for n > 2 and a(1)=0 and a(2)=1.

A156552 Unary-encoded compressed factorization of natural numbers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 8, 7, 6, 9, 16, 11, 32, 17, 10, 15, 64, 13, 128, 19, 18, 33, 256, 23, 12, 65, 14, 35, 512, 21, 1024, 31, 34, 129, 20, 27, 2048, 257, 66, 39, 4096, 37, 8192, 67, 22, 513, 16384, 47, 24, 25, 130, 131, 32768, 29, 36, 71, 258, 1025, 65536, 43, 131072, 2049, 38, 63, 68, 69, 262144
Offset: 1

Author

Leonid Broukhis, Feb 09 2009

Keywords

Comments

The primes become the powers of 2 (2 -> 1, 3 -> 2, 5 -> 4, 7 -> 8); the composite numbers are formed by taking the values for the factors in the increasing order, multiplying them by the consecutive powers of 2, and summing. See the Example section.
From Antti Karttunen, Jun 27 2014: (Start)
The odd bisection (containing even terms) halved gives A244153.
The even bisection (containing odd terms), when one is subtracted from each and halved, gives this sequence back.
(End)
Question: Are there any other solutions that would satisfy the recurrence r(1) = 0; and for n > 1, r(n) = Sum_{d|n, d>1} 2^A033265(r(d)), apart from simple variants 2^k * A156552(n)? See also A297112, A297113. - Antti Karttunen, Dec 30 2017

Examples

			For 84 = 2*2*3*7 -> 1*1 + 1*2 + 2*4 + 8*8 =  75.
For 105 = 3*5*7 -> 2*1 + 4*2 + 8*4 = 42.
For 137 = p_33 -> 2^32 = 4294967296.
For 420 = 2*2*3*5*7 -> 1*1 + 1*2 + 2*4 + 4*8 + 8*16 = 171.
For 147 = 3*7*7 = p_2 * p_4 * p_4 -> 2*1 + 8*2 + 8*4 = 50.
		

Crossrefs

One less than A005941.
Inverse permutation: A005940 with starting offset 0 instead of 1.
Cf. also A297106, A297112 (Möbius transform), A297113, A153013, A290308, A300827, A323243, A323244, A323247, A324201, A324812 (n for which a(n) is a square), A324813, A324822, A324823, A324398, A324713, A324815, A324819, A324865, A324866, A324867.

Programs

  • Mathematica
    Table[Floor@ Total@ Flatten@ MapIndexed[#1 2^(#2 - 1) &, Flatten[ Table[2^(PrimePi@ #1 - 1), {#2}] & @@@ FactorInteger@ n]], {n, 67}] (* Michael De Vlieger, Sep 08 2016 *)
  • PARI
    a(n) = {my(f = factor(n), p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res}; \\ David A. Corneth, Mar 08 2019
    
  • 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)};
    A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n)))); \\ (based on the given recurrence) - Antti Karttunen, Mar 08 2019
    
  • Perl
    # Program corrected per instructions from Leonid Broukhis. - Antti Karttunen, Jun 26 2014
    # However, it gives correct answers only up to n=136, before corruption by a wrap-around effect.
    # Note that the correct answer for n=137 is A156552(137) = 4294967296.
    $max = $ARGV[0];
    $pow = 0;
    foreach $i (2..$max) {
    @a = split(/ /, `factor $i`);
    shift @a;
    $shift = 0;
    $cur = 0;
    while ($n = int shift @a) {
    $prime{$n} = 1 << $pow++ if !defined($prime{$n});
    $cur |= $prime{$n} << $shift++;
    }
    print "$cur, ";
    }
    print "\n";
    (Scheme, with memoization-macro definec from Antti Karttunen's IntSeq-library, two different implementations)
    (definec (A156552 n) (cond ((= n 1) 0) (else (+ (A000079 (+ -2 (A001222 n) (A061395 n))) (A156552 (A052126 n))))))
    (definec (A156552 n) (cond ((= 1 n) (- n 1)) ((even? n) (+ 1 (* 2 (A156552 (/ n 2))))) (else (* 2 (A156552 (A064989 n))))))
    ;; Antti Karttunen, Jun 26 2014
    
  • Python
    from sympy import primepi, factorint
    def A156552(n): return sum((1<Chai Wah Wu, Mar 10 2023

Formula

From Antti Karttunen, Jun 26 2014: (Start)
a(1) = 0, a(n) = A000079(A001222(n)+A061395(n)-2) + a(A052126(n)).
a(1) = 0, a(2n) = 1+2*a(n), a(2n+1) = 2*a(A064989(2n+1)). [Compare to the entanglement recurrence A243071].
For n >= 0, a(2n+1) = 2*A244153(n+1). [Follows from the latter clause of the above formula.]
a(n) = A005941(n) - 1.
As a composition of related permutations:
a(n) = A003188(A243354(n)).
a(n) = A054429(A243071(n)).
For all n >= 1, A005940(1+a(n)) = n and for all n >= 0, a(A005940(n+1)) = n. [The offset-0 version of A005940 works as an inverse for this permutation.]
This permutations also maps between the partition-lists A112798 and A125106:
A056239(n) = A161511(a(n)). [The sums of parts of each partition (the total sizes).]
A003963(n) = A243499(a(n)). [And also the products of those parts.]
(End)
From Antti Karttunen, Oct 09 2016: (Start)
A161511(a(n)) = A056239(n).
A029837(1+a(n)) = A252464(n). [Binary width of terms.]
A080791(a(n)) = A252735(n). [Number of nonleading 0-bits.]
A000120(a(n)) = A001222(n). [Binary weight.]
For all n >= 2, A001511(a(n)) = A055396(n).
For all n >= 2, A000120(a(n))-1 = A252736(n). [Binary weight minus one.]
A252750(a(n)) = A252748(n).
a(A250246(n)) = A252754(n).
a(A005117(n)) = A277010(n). [Maps squarefree numbers to a permutation of A003714, fibbinary numbers.]
A085357(a(n)) = A008966(n). [Ditto for their characteristic functions.]
For all n >= 0:
a(A276076(n)) = A277012(n).
a(A276086(n)) = A277022(n).
a(A260443(n)) = A277020(n).
(End)
From Antti Karttunen, Dec 30 2017: (Start)
For n > 1, a(n) = Sum_{d|n, d>1} 2^A033265(a(d)). [See comments.]
More linking formulas:
A106737(a(n)) = A000005(n).
A290077(a(n)) = A000010(n).
A069010(a(n)) = A001221(n).
A136277(a(n)) = A181591(n).
A132971(a(n)) = A008683(n).
A106400(a(n)) = A008836(n).
A268411(a(n)) = A092248(n).
A037011(a(n)) = A010052(n) [conjectured, depends on the exact definition of A037011].
A278161(a(n)) = A046951(n).
A001316(a(n)) = A061142(n).
A277561(a(n)) = A034444(n).
A286575(a(n)) = A037445(n).
A246029(a(n)) = A181819(n).
A278159(a(n)) = A124859(n).
A246660(a(n)) = A112624(n).
A246596(a(n)) = A069739(n).
A295896(a(n)) = A053866(n).
A295875(a(n)) = A295297(n).
A284569(a(n)) = A072411(n).
A286574(a(n)) = A064547(n).
A048735(a(n)) = A292380(n).
A292272(a(n)) = A292382(n).
A244154(a(n)) = A048673(n), a(A064216(n)) = A244153(n).
A279344(a(n)) = A279339(n), a(A279338(n)) = A279343(n).
a(A277324(n)) = A277189(n).
A037800(a(n)) = A297155(n).
For n > 1, A033265(a(n)) = 1+A297113(n).
(End)
From Antti Karttunen, Mar 08 2019: (Start)
a(n) = A048675(n) + A323905(n).
a(A324201(n)) = A000396(n), provided there are no odd perfect numbers.
The following sequences are derived from or related to the base-2 expansion of a(n):
A000265(a(n)) = A322993(n).
A002487(a(n)) = A323902(n).
A005187(a(n)) = A323247(n).
A324288(a(n)) = A324116(n).
A323505(a(n)) = A323508(n).
A079559(a(n)) = A323512(n).
A085405(a(n)) = A323239(n).
The following sequences are obtained by applying to a(n) a function that depends on the prime factorization of its argument, which goes "against the grain" because a(n) is the binary code of the factorization of n, which in these cases is then factored again:
A000203(a(n)) = A323243(n).
A033879(a(n)) = A323244(n) = 2*a(n) - A323243(n),
A294898(a(n)) = A323248(n).
A000005(a(n)) = A324105(n).
A000010(a(n)) = A324104(n).
A083254(a(n)) = A324103(n).
A001227(a(n)) = A324117(n).
A000593(a(n)) = A324118(n).
A001221(a(n)) = A324119(n).
A009194(a(n)) = A324396(n).
A318458(a(n)) = A324398(n).
A192895(a(n)) = A324100(n).
A106315(a(n)) = A324051(n).
A010052(a(n)) = A324822(n).
A053866(a(n)) = A324823(n).
A001065(a(n)) = A324865(n) = A323243(n) - a(n),
A318456(a(n)) = A324866(n) = A324865(n) OR a(n),
A318457(a(n)) = A324867(n) = A324865(n) XOR a(n),
A318458(a(n)) = A324398(n) = A324865(n) AND a(n),
A318466(a(n)) = A324819(n) = A323243(n) OR 2*a(n),
A318467(a(n)) = A324713(n) = A323243(n) XOR 2*a(n),
A318468(a(n)) = A324815(n) = A323243(n) AND 2*a(n).
(End)

Extensions

More terms from Antti Karttunen, Jun 28 2014

A141414 Least k for which A140361(n) = k.

Original entry on oeis.org

1, 3, 5, 7, 13, 41, 113, 311, 1821, 10267, 74587, 1015453, 12550793
Offset: 0

Author

Leonid Broukhis, Aug 04 2008

Keywords

Examples

			a(1) = 3: 3 can be written as 2+1, requiring 1 operation
a(2) = 5: 5 = (2+1)+2, the lowest number requiring 2 operations
a(3) = 7: ((2+2)+1)+2, the lowest number requiring 3 operations
a(4) = 13: (2+1)*3+2+2 (Note: 3 = 2+1 reused)
a(5) = 41: (2+1)*2*6+3+2 (3 = 2+1 reused, 6 = 3*2 reused)
a(6) = 113: ((2+1)*3+3+1)*9-4
a(7) = 311: ((2+1)*3*3+1)*(9+2)+3
a(8) = 1821: (2+(2+1))*(3+(2+2)*4)*19+16
a(9) = 10267: (1+(2+(2+1))*(3*3))*(5*45-2)+9
a(10) = 74587: (2+1)*(((2*(3*3)*9-2)-3)*157+160)+160
		

Crossrefs

Cf. A217032.

Extensions

Comment removed and three new entries added by Jeffrey Wang (jeffreyw(AT)stanford.edu), Oct 10 2009
a(11)-a(12) from Gil Dogon, Apr 25 2013

A140361 Number of additions, subtractions, or multiplications necessary to reach n starting from 1 and 2.

Original entry on oeis.org

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

Author

Leonid Broukhis, Jul 21 2008

Keywords

Comments

Koiran calls this function tau(n). - Leonid Broukhis, Aug 04 2008
In the model used here a computation of length h of an integer n is a sequence of integers (n_{-1}=1, n_0=2, n_1, ..., n_h=n) such that for each i >= 1 there exist j,k < i and o in {+,-,*} with n_i = n_j o n_k. a(0)=a(1)=a(2)=0 and for n >= 3, a(n) is equal to the length of a shortest computation of n. - Alois P. Heinz, Sep 20 2012

Examples

			a(7) = 3 because we have 7 = (1+2)+(2*2), or 7 = 2*(2+2)-1 and there is no shorter way; the sequences are (1,2,3,4,7) or (1,2,4,8,7), respectively.
		

Crossrefs

Cf. A173419.

Programs

  • Maple
    g:= f->seq(f union {t}, t={seq(seq({i+j, i-j, i*j}[], j=f), i=f)} minus f):
    F:= proc(n) F(n):= map(g, F(n-1)) end: F(0):= {{1, 2}}:
    S:= proc(n) S(n):= map(x->x[], F(n)) minus S(n-1) end: S(0):= {0, 1, 2}:
    a:= proc(n) local k; for k from 0 while not(n in S(k)) do od; k end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Sep 24 2012

Formula

a(n) = A173419(n) - 1 for n > 1. Hence log_2(log_2(n)) <= a(n) <= 2*log_2(n) - 1. - Charles R Greathouse IV, Sep 20 2012

Extensions

Corrected, from 6 to 5, a(59) = ((2+2)*2)*8-1-4 and a(94) = (((2+2)+2)+4)*10-6, by Leonid Broukhis, Aug 04 2008
a(24) and a(96) corrected by Charles R Greathouse IV, Sep 20 2012

A097105 Gregorian years containing two Islamic New Year Days.

Original entry on oeis.org

640, 672, 705, 738, 770, 803, 835, 868, 900, 933, 966, 998, 1031, 1063, 1096, 1129, 1161, 1194, 1226, 1259, 1291, 1324, 1357, 1389, 1422, 1454, 1487, 1520, 1552, 1585, 1617, 1650, 1682, 1715, 1748, 1780, 1813, 1845, 1878, 1911, 1943, 1976, 2008, 2041
Offset: 1

Author

Leonid Broukhis, Sep 15 2004

Keywords

Comments

Gregorian years containing "blue" Islamic New Year Days. The boundary of a calendrical period is hereby called "blue" w.r.t. a similarly named period in another calendar when the shorter one does not contain the boundaries of the longer one. Gregorian calendar prior to 1582 is proleptic, extrapolated according to the calculator in the links.
The ratio of Gregorian to Islamic Year is 365.2425/354.36666... = 438291/425240. The interesting approximating continuous fractions are 403/391, 638/619, 1041/1010 and a very long sequence of (1041+403*n)/(1010+391*n), ending with 7489/7266, so the 403/391 pattern will remain for thousands of years.
Because 4382910 Islamic years = 1553157207 days = 4252400 Gregorian years, each cycle contains 130510 blue Gregorian years and therefore a(n + 130510*k) = a(n) + 425400*k for k >= 0. - Robert B Fowler, Dec 06 2022
Note that the unique "crosspoint" year of the two calendars (20874) is also a blue year, with the first Islamic New Year falling on January 3, i.e., 01/01/20874 (Islamic) = 01/03/20874 (Gregorian). - Robert B Fowler, Dec 06 2022

Examples

			1396-1-1 A.H. = 1976-01-03 C.E.
1397-1-1 A.H. = 1976-12-23 C.E. therefore 1976 is listed. (Corrected by _Robert B Fowler_, Mar 03 2022)
		

Crossrefs

Cf. A350539.

Formula

I(i) = chronological Julian Day Number (JDN) of New Year day of Islamic year i
= 1948086 + floor((10631*i+3)/30) (see A350539)
G(g) = JDN of New Year day of Gregorian year g+1 (not year g)
= 1721426 + floor(1461*g/4) - floor(g/100) + floor(g/400)
initialize values: i=1, g=621, n=0
repeat forever:
increment: i = i+1, g = g+1
IF I(i) < G(g) THEN n = n+1, a(n) = g, i = i+1 - Robert B Fowler, Dec 06 2022

Extensions

New name by Robert B Fowler, Mar 03 2022

A082757 Possible integer ratios of A/B, where A and B have no 0 in their decimal representation, all decimal digits of A and B are different and each digit is used only once.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 26, 27, 28, 29, 32, 35, 37, 38, 43, 44, 46, 52, 53, 59, 62, 66, 68, 134, 143, 148, 152, 155, 163, 164, 168, 173, 176, 178, 182, 185, 188, 194, 197, 198, 203, 206, 212, 215, 224, 225, 227
Offset: 1

Author

Leonid Broukhis, May 21 2003

Keywords

Comments

The sequence has 179540 terms, the last being 98765432. - Giovanni Resta, Mar 21 2013

Examples

			13458 / 6729 = 2
17469 / 5823 = 3
15768 / 3942 = 4
...
98765432 / 1 = 98765432
		

Programs

  • Mathematica
    f[w_] := Select[Floor[w/10^#]/Mod[w, 10^#] & /@ {1,2,3,4}, IntegerQ]; seq = Union[Flatten[f /@ (FromDigits /@ Permutations[ Range@9])]]; Length[seq] (* Giovanni Resta, Mar 21 2013 *)

Extensions

a(37)-a(60) from Giovanni Resta, Mar 21 2013