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

A256075 Non-palindromic balanced numbers (in base 10).

Original entry on oeis.org

1030, 1140, 1250, 1302, 1360, 1412, 1470, 1522, 1580, 1603, 1632, 1690, 1713, 1742, 1823, 1852, 1904, 1933, 1962, 2031, 2060, 2141, 2170, 2251, 2280, 2303, 2361, 2390, 2413, 2471, 2523, 2581, 2604, 2633, 2691, 2714, 2743, 2824, 2853, 2905, 2934, 2963, 3032, 3061, 3090, 3142, 3171, 3252, 3281, 3304, 3362, 3391, 3414
Offset: 1

Views

Author

Eric Angelini and M. F. Hasler, Mar 14 2015

Keywords

Comments

Here a number is called balanced if the sum of digits weighted by their arithmetic distance from the "center" is zero.
All 1-, 2- or 3-digit balanced numbers are palindromic, therefore all terms are larger than 1000.
The least 1-9 pandigital balanced number seems to be 137986542, but there seems to be no 0-9 pandigital balanced number.

Examples

			a(1)=1030 is balanced because 1*3/2 + 0*1/2 = 3*1/2 + 0*3/2.
a(2)=1140 is balanced because 1*3/2 + 1*1/2 = 4*1/2 + 0*3/2.
		

Crossrefs

Cf. A256076 (primes in this sequence), A256082 - A256089, A256080.

Programs

  • Maple
    filter:= proc(n) local L,m;
      L:= convert(n,base,10);
      m:= (1+nops(L))/2;
    add(L[i]*(i-m),i=1..nops(L))=0  and L <> ListTools:-Reverse(L)
    end proc:
    select(filter, [$1000..10000]); # Robert Israel, May 29 2018
  • PARI
    is(n,b=10,d=digits(n,b),o=(#d+1)/2)=!(vector(#d,i,i-o)*d~)&&d!=Vecrev(d)

A256080 Non-palindromic balanced numbers in base 16.

Original entry on oeis.org

4144, 4416, 4688, 4866, 4960, 5138, 5232, 5410, 5504, 5635, 5682, 5776, 5907, 5954, 6048, 6179, 6226, 6320, 6404, 6451, 6498, 6592, 6676, 6723, 6770, 6864, 6948, 6995, 7042, 7136, 7173, 7220, 7267, 7314, 7408, 7445, 7492, 7539, 7586, 7717, 7764, 7811, 7858, 7942, 7989
Offset: 1

Views

Author

M. F. Hasler, Mar 14 2015

Keywords

Comments

Here a number is called balanced if the sum of digits weighted by their arithmetic distance from the "center" is zero. Palindromes (A029730) are trivially balanced, therefore they are excluded here.
This is the hexadecimal variant of the decimal version A256075 invented by Eric Angelini. See there, and the base-2 version A256082, for further information and examples.See A256090 for the primes in this sequence.

Crossrefs

Programs

  • PARI
    is(n,b=16,d=digits(n,b),o=(#d+1)/2)=!(vector(#d,i,i-o)*d~)&&d!=Vecrev(d)

A256081 Non-palindromic balanced primes in base 2.

Original entry on oeis.org

397, 1427, 1459, 1483, 1613, 1693, 4657, 4721, 4931, 5077, 5273, 5581, 5651, 5749, 6043, 6329, 6637, 6701, 6791, 7127, 7211, 7547, 10069, 10937, 10979, 12011, 12757, 13597, 13789, 18121, 18217, 18307, 18947, 19013, 19141, 19237, 19267, 19813, 19861
Offset: 1

Views

Author

M. F. Hasler, Mar 14 2015

Keywords

Comments

Here a number is called balanced if the sum of digits weighted by their arithmetic distance from the "center" is zero. Obviously, all palindromic numbers are balanced; cf. A016041 for base-2 palindromic primes.
These are the primes in A256082. This is the binary variant of the decimal version A256076 suggested by Eric Angelini.

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L, m;
      L:= convert(n, base, 2);
      m:= (1+nops(L))/2;
      add(L[i]*(i-m), i=1..nops(L))=0 and isprime(n) and L <> ListTools:-Reverse(L)
    end proc: select(filter, [seq(i,i=3..20000,2)]);# Robert Israel, May 29 2018
  • PARI
    is(n,b=2,d=digits(n,b),o=(#d+1)/2)=!(vector(#d,i,i-o)*d~)&&d!=Vecrev(d)&&isprime(n)

A256086 Non-palindromic balanced numbers in base 6.

Original entry on oeis.org

234, 276, 318, 326, 368, 410, 451, 493, 535, 543, 585, 627, 668, 710, 752, 760, 802, 844, 885, 927, 969, 977, 1019, 1061, 1102, 1144, 1186, 1308, 1344, 1380, 1416, 1452, 1488, 1530, 1566, 1602, 1638, 1674, 1710, 1730, 1752, 1766, 1788, 1802, 1824, 1838, 1860, 1874, 1896, 1910, 1932, 1952, 1974, 1988
Offset: 1

Views

Author

M. F. Hasler, Mar 14 2015

Keywords

Comments

Here a number is called balanced if the sum of digits weighted by their arithmetic distance from the "center" is zero. Since palindromes (A029953) are trivially balanced, they are excluded here.
This is the base-6 variant of the decimal version A256075 invented by Eric Angelini. See there, and the base-2 version A256082, for further information and examples.

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L, m,i;
      L:= convert(n, base, 6);
      m:= (1+nops(L))/2;
    add(L[i]*(i-m), i=1..nops(L))=0  and L <> ListTools:-Reverse(L)
    end proc:
    select(filter, [$1..10000]); # Robert Israel, Nov 04 2024
  • PARI
    is(n,b=6,d=digits(n,b),o=(#d+1)/2)=!(vector(#d,i,i-o)*d~)&d!=Vecrev(d)

A256090 Non-palindromic balanced primes in base 16.

Original entry on oeis.org

6451, 7717, 8513, 8963, 9601, 10501, 10867, 11317, 11411, 12227, 13829, 14561, 15461, 15733, 16183, 16529, 16979, 18517, 19333, 19427, 19699, 20149, 20233, 20327, 22483, 22567, 23027, 23561, 23833, 25717, 26083, 26261, 26711, 27077, 27527, 27799, 27893, 28867, 29411, 29683, 30133, 30677, 30949, 31033, 31849
Offset: 1

Views

Author

M. F. Hasler, Mar 14 2015

Keywords

Comments

Here a number is called balanced if the sum of digits weighted by their arithmetic distance from the "center" is zero. Palindromic primes (A029732 in base 16) are trivially balanced, therefore they are excluded here.
These are the primes in A256080. This is the hexadecimal variant of the decimal version A256076 suggested by Eric Angelini.

Crossrefs

Programs

  • PARI
    is(n,b=16,d=digits(n,b),o=(#d+1)/2)=!(vector(#d,i,i-o)*d~)&&d!=Vecrev(d)&&isprime(n)

A330491 Non-palindromic balanced primes in base 3.

Original entry on oeis.org

137, 991, 1109, 1237, 1291, 1301, 1471, 1663, 1721, 1861, 1871, 7057, 7219, 7507, 7537, 7699, 8291, 8597, 8707, 9091, 9587, 9697, 9857, 10159, 10163, 10211, 10273, 10321, 10627, 10631, 10739, 11027, 11437, 11551, 11777, 11887, 12239, 12401, 12659, 12671, 12821
Offset: 1

Views

Author

Thorben Böger, Dec 16 2019

Keywords

Comments

A number is called "balanced" here if the sum of digits weighted by their arithmetic distance from the "center" of the number is zero. Palindromic primes (A029971) are "trivially" balanced, so they are excluded here.
These are the primes in A256083, respectively the intersection of A000040 and A256083.

Examples

			a(7) = 1471 as 1471 is prime and 2000111 in base 3, which is balanced: 3*2 = 1*1 + 2*1 + 3*1.
		

Crossrefs

Programs

  • PARI
    ok(n)={my(v=digits(n,3)); isprime(n) && !sum(i=1, #v, v[i]*((#v+1)/2-i)) && Vecrev(v)<>v} \\ Andrew Howroyd, Dec 23 2019
  • Python
    from primes_file import primes#list containing first 3 million primesfrom baseconvert import base as bdef isbalanced(converted):    return sum([(place - (len(converted)/2 - 0.5))*digit for place, digit in enumerate(converted)]) == 0balanced_primes_list = [prime for prime in primes if(b(prime, 10, 3) != b(prime, 10, 3)[::-1] and isbalanced(b(prime, 10, 3)))]
    
Showing 1-6 of 6 results.