%I #48 Sep 29 2023 10:19:55
%S 480,481,482,483,484,485,486,487,488,489,736,737,738,739,740,741,742,
%T 743,744,745,992,993,994,995,996,997,998,999,1000,1001,1248,1249,1250,
%U 1251,1252,1253,1254,1255,1256,1257,1504,1505,1506,1507,1508,1509,1510,1511
%N Decimal representations of hexadecimal numbers that can be misinterpreted as decimal numbers in scientific E notation.
%C Hexadecimal numbers containing no alpha digits other than a single "e", where the "e" is not the first or last digit (e.g., 3e12), may be misinterpreted as numbers in scientific E notation.
%C These numbers are especially troublesome when importing hexadecimal numbers from CSV files into Microsoft Excel.
%C These numbers can be written as 16^(i+1)a + 14*16^i + b where a and b are members of A102489 with a>0, b<16^i and i>0.
%C Numbers whose hexadecimal representation matches the regular expression [1-9][0-9]*e[0-9]+. - _Eric M. Schmidt_, Sep 28 2023
%H Christian Perfect, <a href="/A262222/b262222.txt">Table of n, a(n) for n = 1..99999</a>
%H Microsoft Community, <a href="http://answers.microsoft.com/en-us/office/forum/office_2007-excel/disabling-scientific-notation/943b8103-8c50-451d-8037-c697422e2307">Unable to disable scientific notation in Microsoft Excel</a>.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Scientific_notation#E_notation">Scientific E notation</a>.
%e 480_10 = 1e0_16 and 1e0 = 1 in E notation.
%e 739_10 = 2e3_16 and 2e3 = 2000_10 in E notation.
%o (C++)
%o #include <iostream>
%o #include <string>
%o using namespace std;
%o int main()
%o {
%o int n = 0; //integer to check
%o char hexRepresentation[12];
%o for (int i = 0; i < 100;) //integers found (first 100)
%o {
%o sprintf(hexRepresentation, "%x", n); //get hex representation
%o char* foundE = strchr(hexRepresentation, 'e'); //look for letter e
%o if (foundE != NULL && //at least one e
%o hexRepresentation != foundE && //not the first digit
%o strpbrk(hexRepresentation, "abcdef") == foundE && //e is not first alpha
%o strlen(foundE) != 1 && //something after the e
%o strpbrk(foundE + sizeof(char), "abcdef") == NULL) //no alpha after the e
%o {
%o cout << n << "\n"; //output n
%o i++; //discovered an integer
%o }
%o n++; //check next value
%o }
%o }
%o (Python)
%o from itertools import count,product
%o # every string of d characters with exactly one 'e' in it, and all the other characters digits 0-9, in ascending lexicographic order
%o def mids(d):
%o if d<1:
%o raise Exception("d<1")
%o if d==1:
%o yield 'e'
%o return
%o for i in range(0,10):
%o for m in mids(d-1):
%o yield str(i)+m
%o for i in range(10**(d-1)):
%o yield 'e'+str(i).zfill(d-1)
%o def a_generator():
%o for d in count(1):
%o for start in range(1,10): # for each leading digit 1-9
%o for mid in mids(d): # for all possible middles made of d characters, containing exactly one 'e'
%o for end in range(10): #for each possible final digit, 0-9
%o s = '{}{}{}'.format(start,''.join(mid),end)
%o i = int(s,16)
%o yield i
%o a262222 = a_generator()
%o [next(a262222) for _ in range(48)] # _Christian Perfect_, Oct 20 2015
%o (C)
%o #include <stdbool.h>
%o #define DIGIT_E 14
%o bool isA262222(int k)
%o {
%o if (k <= 0 || k % 16 == DIGIT_E) return false;
%o bool foundE = false;
%o int digit;
%o while (k > 0) {
%o digit = k % 16;
%o if (digit == DIGIT_E) {
%o if (foundE) return false;
%o foundE = true;
%o }
%o else if (digit > 9) return false;
%o k /= 16;
%o }
%o return foundE && digit != DIGIT_E;
%o } // _Eric M. Schmidt_, Sep 28 2023
%Y A subset of A102490.
%K nonn,base
%O 1,1
%A _Adam J.T. Partridge_, Sep 16 2015